Type stubs for SciPy.
Note
This project is in the alpha stage, so some annotations are missing, and some might
be (slightly) incorrect.
But either way, it's no problem to scipy-stubs
at the moment:
Type-checkers will (already) understand scipy
a lot better with scipy-stubs
,
than without it.
The scipy-stubs
package is available as on PyPI:
pip install scipy-stubs
For validation and testing, scipy-stubs
primarily uses
basedmypy
(a mypy
fork) and
basedpyright
(a pyright
fork).
Because they are in generally stricter than mypy
and pyright
, they should be
compatible as well.
If you find that this is not the case, then don't hesitate to open an issue.
The versioning scheme of scipy-stubs
includes the compatible scipy
version.
Later versions might work too, but in case of API-changes, the stubs could be outdated.
Apart from scipy
's own dependencies (e.g. numpy
), the only other
required dependency is optype
.
The exact version requirements are specified in the pyproject.toml
.
Package or module | Stubs status |
---|---|
scipy.__init__ |
3: ready |
scipy._lib |
2: partial |
scipy.cluster |
4: done |
scipy.constants |
4: done |
scipy.datasets |
4: done |
scipy.fft |
3: ready |
scipy.fftpack |
3: ready |
scipy.integrate |
4: done |
scipy.interpolate |
2: partial |
scipy.io |
4: done |
scipy.linalg |
4: done |
scipy.misc |
4: done |
scipy.ndimage |
2: partial |
scipy.odr |
3: ready |
scipy.optimize |
3: ready |
scipy.signal |
2: partial |
scipy.signal.windows |
1: skeleton |
scipy.sparse |
2: partial |
scipy.sparse.csgraph |
2: partial |
scipy.sparse.linalg |
2: partial |
scipy.spatial |
2: partial |
scipy.spatial.distance |
2: partial |
scipy.special |
4: done |
scipy.stats |
2: partial |
scipy.stats.contingency |
3: ready |
scipy.stats.distributions |
4: done |
scipy.stats.mstats |
1: skeleton |
scipy.stats.qmc |
2: partial |
scipy.stats.sampling |
1: skeleton |
scipy.version |
4: done |
Status labels:
- skeleton (mostly succesful stubgen)
- partial (incomplete/broad annotations)
- ready (passes stubtest)
- done (complete, valid, tested, and production-ready)