Installation¶
Requirements¶
- Python >= 3.10
- beartype >= 0.20, installed automatically with
shapix-rt
Install with pip¶
The distribution name is shapix-rt, where rt means runtime. The import path stays:
Shapix intentionally does not use extras such as shapix-rt[numpy]. Install shapix-rt and your backend packages explicitly.
Note
shapix.jax, shapix.torch, and shapix.cupy require numpy alongside the backend. The lightweight root import import shapix does not.
Install with uv¶
Optional dependencies¶
| Package | Purpose |
|---|---|
numpy |
NumPy array aliases, ScalarLike, and backend dtype helpers |
torch |
PyTorch tensor aliases and Torch Like types |
jax |
JAX array aliases, JAX Like types, and JAX Tree |
cupy |
CuPy array aliases and CuPy Like types |
optree |
Explicit OpTree backend via shapix.optree.Tree |
Import boundaries¶
The root package is designed to stay optional-dependency-safe:
That works even in a plain source checkout without installed package metadata. In that case __version__ falls back to a non-empty string such as 0+unknown.
Backend modules are stricter:
shapix.numpyneedsnumpyshapix.jaxneedsjaxandnumpyshapix.torchneedstorchandnumpyshapix.cupyneedscupyandnumpyshapix.optreeneedsoptree
Verify installation¶
Then verify the backend you actually plan to use: