semvec/pypi-packages huggingface dataset:
bahc 2.0.3
Bootstrap Average Hierarchical Clustering for filtering covariance matrices
Requires Python: >=3.10

# BAHC

BAHC (Bootstrap Average Hierarchical Clustering) is a Python package for filtering covariance matrices using hierarchical clustering and bootstrap aggregation.

## Installation

To install the package, you can use pip:

```sh
pip install bahc
```

Alternatively, you can clone the repository and install the dependencies manually:

```sh
git clone https://github.com/yourusername/bahc.git
cd bahc
pip install -r requirements.txt
```

## Usage

Here is an example of how to use the BAHC class:

```python
import numpy as np
from bahc import BAHC

# Generate random data
data = np.random.normal(0, 1, size=(10, 100))

# Create an instance of BAHC and filter the data
bahc_instance = BAHC(data, K=[1, 2, 3], Nboot=100, method='near', filter_type='correlation')

# Print the filtered matrix
print(bahc_instance.filter_matrix())
```

## Methods

### `BAHC.__init__(self, data, K=1, Nboot=100, method='near', filter_type='covariance', seed=None)`

Initializes the BAHC class and performs the filtering.

- `data` (ndarray): Data matrix (N x T).
- `K` (int or list): Recursion order.
- `Nboot` (int): Number of bootstraps.
- `method` (str): Regularization method ('no-neg' or 'near').
- `filter_type` (str): Type of filtering ('correlation' or 'covariance').
- `seed` (int): Random seed.

### `BAHC.filter_matrix(self)`

Filters the matrix using k-BAHC.

- Returns: Filtered matrix (N x N). If K is a list, returns a list of matrices.

### `BAHC.nearest_positive_semidefinite(self, matrix, n_iter=100, eig_tol=1e-6, conv_tol=1e-8)`

Finds the nearest positive semidefinite matrix.

- `matrix` (ndarray): Input matrix.
- `n_iter` (int): Maximum number of iterations.
- `eig_tol` (float): Eigenvalue tolerance.
- `conv_tol` (float): Convergence tolerance.
- Returns: Nearest positive semidefinite matrix.

### `BAHC._higher_order_covariance(self, C, K)`

Computes higher order covariance matrices.

- `C` (ndarray): Input covariance matrix.
- `K` (list): List of recursion orders.
- Yields: Higher order covariance matrices.

### `BAHC._generate_noise(self, epsilon=1e-10)`

Generates noise for the given dimensions.

- `epsilon` (float): Standard deviation of the noise.
- Returns: Generated noise matrix.

### `BAHC._remove_negative_eigenvalues(self, matrix)`

Removes negative eigenvalues from the matrix.

- `matrix` (ndarray): Input matrix.
- Returns: Matrix with non-negative eigenvalues.

## References

- Bongiorno, C., & Challet, D. (2021). Covariance matrix filtering with bootstrapped hierarchies. PLoS ONE, 16(1), e0245092.
- Bongiorno, C., & Challet, D. (2022). Reactive global minimum variance portfolios with k-BAHC covariance cleaning. The European Journal of Finance, 28(13-15), 1344-1360.

Please cite the above papers if you use this code.
space-analysis 2024.11.11
Python library for data analysis in space physics
Requires Python: >=3.10

# space-analysis.py


Python utils for data analysis in space physics. Still in active development, use with caution.

[![PyPI](https://img.shields.io/pypi/v/space-analysis)](https://pypi.org/project/space-analysis)
[![Pixi Badge](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/prefix-dev/pixi/main/assets/badge/v0.json)](https://pixi.sh)
[![pdm-managed](https://img.shields.io/badge/pdm-managed-blueviolet.png)](https://pdm-project.org)

Inspired from [SpaceAnalysis.jl](https://henry2004y.github.io/VisAnaJulia/dev/), created with [nbdev](https://nbdev.fast.ai/).

## References

- [speasy](https://speasy.readthedocs.io) : Python client for Space Physics web services such as CDAWEB or AMDA
- [pyspedas](https://pyspedas.readthedocs.io) : Python Space Physics Environment Data Analysis Software
- [fastcore](https://fastcore.fast.ai) : Python supercharged for the fastai library

## Install

``` sh
pip install space-analysis
```

## How to use
vbpdf 0.1.50
There was this issue with single page pdf in instagram stacking and blurring _ i fixed that.
Requires Python: <4.0,>=3.11
Keywords: split pdf, annotate pdf, pdftopng, png, pdf

# vbpdf
Install using pip

```sh
pip install vbpdf
```

## Usage
```sh
vbpdf -h
```
```sh
Usage: vbpdf [OPTIONS] COMMAND [ARGS]...

Options:
  -h, --help  Show this message and exit.

Commands:
  overlay  Annotates any pdf file.
  split    Splits any pdf file.
  topng    Converts pdf pages into pngs
  addbg	   Adds background to pngs.
```

```sh
vbpdf split -h
```
```sh
Usage: vbpdf split [OPTIONS]

  Splits any pdf file.

Options:
  -i, --inputfile PATH            Input file  [default: ./main.pdf]
  -o, --outputfile PATH           Output file  [default: ./main_splited.pdf]
  -p, --pages <INTEGER INTEGER>...
                                  Pages range  [default: 0, 0]
  -h, --help                      Show this message and exit.
  
```

```sh
vbpdf overlay -h
```

```sh
Usage: vbpdf overlay [OPTIONS]

  Annotates any pdf file.

Options:
  -i, --inputfile PATH            Input file  [default: ./main.pdf]
  -o, --outputfile PATH           Output file  [default: ./main_annotated.pdf]
  -s, --size                      For checking size of the pdf
  -t, --text TEXT                 Text to be placed  [default: Hello Sir!]
  -p, --position <INTEGER INTEGER INTEGER INTEGER>...
                                  Coordintes of the tex box  [default: 0, 0,
                                  100, 100]
  -f, --foreground_color TEXT     Foreground Color  [default: 000000]
  -b, --background_color TEXT     Background Color  [default: ffffff]
  -F, --font TEXT                 Font type  [default: Courier]
  --font_size INTEGER             Font size  [default: 24]
  -h, --help                      Show this message and exit.

```

```sh
vbpdf topng -h
```
```sh
Usage: vbpdf topng [OPTIONS]

  Converts pdf pages into pngs

Options:
  -i, --inputfile PATH            Input file name  [default: ./main.pdf]
  -o, --outputfile PATH           Output file name  [default: ./main.png]
  -d, --dpi INTEGER               DPI -> density per inch for png  [default:
                                  320]
  -t, --transparent               Use this flag for transparent png
  -r, --ranges <INTEGER INTEGER>...
                                  Page range to be converted into png
                                  [default: 1, 1]
  -p, --pages                     Shows no of pages in a pdf file
  -h, --help                      Show this message and exit.

```
paperless-asn-labels 1.0.1
Creates archive serial number (ASN) label sheets
Requires Python: <4.0,>=3.10

# paperless-asn-labels

`paperless-asn-labels` generates PDF documents with archive serial numbers (ASN), both as a machine-readable QR code
and a human-readable number.

Loosely inspired by https://github.com/entropia/paperless-asn-qr-codes.

## Installation

```console
pipx install paperless-asn-labels
```

## Usage

Run `paperless-asn-labels --help` for supported commands and options.

The output will contain pairs of QR codes and numbers as seen below.
![example](example.png)