semvec/pypi-packages huggingface dataset:
pathsig 0.1.1
GPU-accelerated library for scalable and efficient differentiable signature computations.
Requires Python: >=3.8

# pathsig
A high-performance, GPU-accelerated library for differentiable signature computations, with PyTorch integration. Built on a decomposition approach that enables efficient, scalable signature computations with minimal memory usage.

## Installation
```bash
pip install pathsig
```

**Requirements:**
- PyTorch >= 2.0
- CUDA-capable GPU (compute capability >= 7.0)
- Python >= 3.8

## Quick Start
`pathsig` provides both a functional API and a PyTorch module for computing path signatures. The library allows for straightforward usage of the signature as part of machine learning models, acting as a differentiable feature extractor for time series or path data.


```python
import torch
import torch.nn as nn
import torch.optim as optim
import pathsig

# Compute signature of a path
path = torch.randn(1, 100, 3, device='cuda') # (batch_size, sequence_length, path_dim)
sig = pathsig.signature(path, truncation_level=4)
print(sig.shape) # (1, 120)

# Use as a PyTorch module
signature_layer = pathsig.Signature(truncation_level=4).to('cuda')
sig = signature_layer(path)

# As part of a neural network 
class SignatureNet(nn.Module):
    def __init__(self, input_channels, sig_level, num_classes):
        super().__init__()
        self.signature = pathsig.Signature(truncation_level=sig_level)
        sig_dim = pathsig.sig_size(input_channels, sig_level)
        self.classifier = nn.Linear(sig_dim, num_classes)
 
    def forward(self, x):
        sig = self.signature(x)
        return self.classifier(sig)
```


## Limitations
- GPU-only (no CPU support currently).
- Maximum truncation level: 12.
- Maximum path dimension: 1000.

## License
MIT License, see [LICENSE](LICENSE) file for details.
pyfigo 0.1.5
Get the OBJECT keyword from a fits file
Requires Python: >=3.11

<div align="center">
    <img src="https://raw.githubusercontent.com/j-faria/figo/main/logo.png" width="60%" />
    <p>Get the <code>OBJECT</code> keyword from a <em>fits</em> file.</p>
    <p>But like... fast.</p>
</div>


## Install and run

```bash
pip install pyfigo
```

In the command line,
```bash
figo file.fits
```

or in the Python REPL,
```python
>>> import figo
>>> figo('file.fits')
```

## Don't install, just run

```bash
uvx --from pyfigo figo file.fits
```


## FAQ

#### Is it fast?

![comparison](https://raw.githubusercontent.com/j-faria/figo/main/timer.png)
> _This is such an unfair comparison! `astropy` is amazing and does so much more!_

#### Could it be faster?

Try the function `figo.afap('file.fits')` to go as fast as possible.


#### Can I get a keyword other than `OBJECT`?

No. [_Do one thing and do it well_](https://wikipedia.org/wiki/Unix_philosophy).

#### Is it standard compliant?

Yes!

#### Does it work on Windows?

Why wouldn't it? 🤨