Typing stubs for SciPy.
pip install scipy-stubsscipy._ |
ruff & flake8-pyi |
stubtest |
basedmypy |
basedpyright |
phase |
|---|---|---|---|---|---|
_lib |
✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
cluster |
✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
constants |
✔️ | ✔️ | ✔️ | ✔️ | 🌝 |
datasets |
✔️ | ✔️ | ✔️ | ✔️ | 🌝 |
fft |
✔️ | ✔️ | ✔️ | ✔️ | 🌒 |
fftpack |
✔️ | ✔️ | ✔️ | ✔️ | 🌒 |
integrate |
✔️ | ✔️ | ✔️ | ✔️ | 🌔 |
interpolate |
✔️ | ✔️ | ✔️ | ✔️ | 🌓 |
io |
✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
linalg |
✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
misc |
✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
ndimage |
✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
odr |
✔️ | ✔️ | ✔️ | ✔️ | 🌒 |
optimize |
✔️ | ✔️ | ✔️ | ✔️ | 🌓 |
signal |
✔️ | ✔️ | ✔️ | ✔️ | 🌒 |
sparse |
✔️ | ✔️ | ✔️ | ✔️ | 🌒 |
spatial |
✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
special |
✔️ | ✔️ | ✔️ | ✔️ | 🌓 |
stats |
✔️ | ✔️ | ✔️ | ✔️ | 🌔 |
For validation and testing, scipy-stubs primarily uses basedmypy (a mypy fork)
and basedpyright (a pyright fork).
They are in generally stricter than mypy and pyright, so you can assume compatibility with mypy and pyright as well.
But if you find that this isn't the case, then don't hesitate to open an issue or submit a pull request.
The versioning scheme of scipy-stubs includes the compatible scipy version as {scipy_version}.{stubs_version}.
Even though scipy-stubs doesn't enforce an upper bound on the scipy version, later scipy versions aren't guaranteed to be
fully compatible.
Apart from scipy's own dependencies, (e.g. numpy), the only other required dependency is
optype, which itself only depends on typing_extensions.
The exact version requirements are specified in the pyproject.toml.