Installation
PySTL requires Python 3.11 or later. The core package depends only on NumPy. JAX and PyTorch support are optional extras.
Using uv (recommended)
uv is the recommended package manager for PySTL.
# NumPy only (default)
uv sync
# NumPy + JAX
uv sync --extra jax
# NumPy + PyTorch
uv sync --extra torch
# All backends
uv sync --extra jax --extra torch
Using pip
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # on Windows: .venv\Scripts\activate
# NumPy only
pip install -e .
# NumPy + JAX
pip install -e ".[jax]"
# NumPy + PyTorch
pip install -e ".[torch]"
# All backends
pip install -e ".[jax,torch]"
Verifying the installation
from pystl import registry
print(registry.syntaxes()) # ['agm', 'classical', 'cumulative', 'dgmsr', 'smooth']
print(registry.backends()) # ['numpy'] or ['jax', 'numpy'] or ['jax', 'numpy', 'torch']
If JAX or PyTorch are not installed, their backends will simply not appear in registry.backends().
Development install
To contribute to PySTL, install with the dev dependency group:
# Dev tools (pytest, pre-commit, pylint) + NumPy only
uv sync --dev
# Dev tools + JAX
uv sync --dev --extra jax
# Dev tools + PyTorch
uv sync --dev --extra torch
Then install the pre-commit hooks:
pre-commit install
See CONTRIBUTING for the full contribution workflow.