Name | scipy-stubs JSON |
Version |
1.15.2.0
JSON |
| download |
home_page | None |
Summary | Type annotations for SciPy |
upload_time | 2025-02-17 05:04:44 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | None |
keywords |
pep484
scipy
typing
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<h1 align="center">scipy-stubs</h1>
<p align="center">
Precise type hints for <i>all</i> of <a href="https://github.com/scipy/scipy">SciPy</a>.
</p>
<p align="center">
<a href="https://pypi.org/project/scipy-stubs/">
<img
alt="scipy-stubs - PyPI"
src="https://img.shields.io/pypi/v/scipy-stubs?style=flat&color=olive"
/>
</a>
<a href="https://anaconda.org/conda-forge/scipy-stubs">
<img
alt="scipy-stubs - conda-forge"
src="https://anaconda.org/conda-forge/scipy-stubs/badges/version.svg"
/>
</a>
<a href="https://github.com/scipy/scipy-stubs">
<img
alt="scipy-stubs - Python Versions"
src="https://img.shields.io/pypi/pyversions/scipy-stubs?style=flat"
/>
</a>
<a href="https://github.com/scipy/scipy-stubs">
<img
alt="scipy-stubs - license"
src="https://img.shields.io/github/license/scipy/scipy-stubs?style=flat"
/>
</a>
</p>
<p align="center">
<a href="https://github.com/scipy/scipy-stubs/actions?query=workflow%3ACI">
<img
alt="scipy-stubs - CI"
src="https://github.com/scipy/scipy-stubs/workflows/CI/badge.svg"
/>
</a>
<a href="https://github.com/pre-commit/pre-commit">
<img
alt="scipy-stubs - pre-commit"
src="https://img.shields.io/badge/pre--commit-enabled-teal?logo=pre-commit"
/>
</a>
<a href="https://github.com/KotlinIsland/basedmypy">
<img
alt="scipy-stubs - basedmypy"
src="https://img.shields.io/badge/basedmypy-checked-fd9002"
/>
</a>
<a href="https://detachhead.github.io/basedpyright">
<img
alt="scipy-stubs - basedpyright"
src="https://img.shields.io/badge/basedpyright-checked-42b983"
/>
</a>
<a href="https://github.com/astral-sh/ruff">
<img
alt="scipy-stubs - ruff"
src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json"
/>
</a>
</p>
______________________________________________________________________
## Highlights
- Works out-of-the-box
- all that's needed is to [install `scipy-stubs`](#installation)
- does not require a `mypy` plugin or other configuration
- available on [PyPI](https://pypi.org/project/scipy-stubs/) and [conda-forge](https://anaconda.org/conda-forge/scipy-stubs)
- Improves IDE suggestions and autocompletion
- ... even if you don't use static typing in your code
- no additional plugins required
- 0% runtime overhead
- not even a single import is required
- 100% coverage of the [public SciPy API](https://docs.scipy.org/doc/scipy/reference/index.html)
- also covers most of the private API
- Precise type-hinting of dtypes and [shape-types](https://github.com/numpy/numpy/issues/16544)
- works with all "array-likes" and "dtype-likes"
- many of the functions that return an array are *shape-typed*
- shape-typing is optional: all functions still accept arrays with unknown shape-type
- Type-checker agnostic
- works with at least [`mypy`](https://github.com/KotlinIsland/basedmypy),
[`pyright`](https://github.com/DetachHead/basedpyright)/pylance and [`ruff`](https://github.com/astral-sh/ruff)
- ... even in the strict mode
- compatible with the [Python Typing Spec](https://typing.readthedocs.io/en/latest/spec/index.html)
- [SPEC 0](https://scientific-python.org/specs/spec-0000/) compliant
- Supports Python ≥ 3.10
- Supports NumPy ≥ 1.23.5
<!-- NOTE: SciPy permalinks to the following `#installation` anchor; don't modify it! -->
## Installation
The source code is currently hosted on GitHub at [github.com/scipy/scipy-stubs](https://github.com/scipy/scipy-stubs/).
Binary distributions are available at the [Python Package Index (PyPI)](https://pypi.org/project/scipy-stubs/) and on
[conda-forge](https://anaconda.org/conda-forge/scipy-stubs).
### Using pip (PyPI)
To install from the [PyPI](https://pypi.org/project/scipy-stubs/), run:
```bash
pip install scipy-stubs
```
In case you haven't installed `scipy` yet, both can be installed with:
```bash
pip install scipy-stubs[scipy]
```
### Using conda (conda-forge)
To install using Conda from the [conda-forge channel](https://anaconda.org/conda-forge/scipy-stubs), run:
```bash
conda install conda-forge::scipy-stubs
```
It's also possible to install both `scipy` and `scipy-stubs` together through the bundled
[`scipy-typed`](https://anaconda.org/conda-forge/scipy-typed) package:
```bash
conda install conda-forge::scipy-typed
```
### Packages overview
<table>
<tr>
<th rowspan="2" colspan="2"></th>
<th colspan="2">Python packages</th>
</tr>
<tr>
<th><code>scipy-stubs</code></th>
<th><code>scipy</code> + <code>scipy-stubs</code></td>
</tr>
<tr>
<th>PyPI</th>
<th align="right"><code>pip install {}</code></th>
<td><code>scipy-stubs</code></td>
<td><code>scipy-stubs[scipy]</code></td>
</tr>
<tr>
<th>conda-forge</th>
<th align="right"><code>conda install conda-forge::{}</code></th>
<td><code>scipy-stubs</code></td>
<td><code>scipy-typed</code></td>
</tr>
</table>
## Versioning and requirements
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.
There are no additional restrictions enforced by `scipy-stubs` on the `numpy` requirements.
For `scipy[-stubs]` `1.14.*` and `1.15.*` that is `numpy >= 1.23.5`.
Currently, `scipy-stubs` has one required dependency: [`optype`](https://github.com/jorenham/optype).
This is essential for `scipy-stubs` to work properly, as it relies heavily on it for annotating (shaped) array-likes,
scalar-likes, shape-typing in general, and much more.
At the moment, `scipy-stubs` requires the latest version `optype`.
The exact version requirements are specified in the [`pyproject.toml`](pyproject.toml).
## Supported static type-checkers
1. [`basedpyright`](https://github.com/DetachHead/basedpyright) (recommended)
1. [`basedmypy`](https://github.com/KotlinIsland/basedmypy)
1. [`pyright`](https://pyright.readthedocs.io/en/latest/index.html)
1. [`mypy`](https://mypy.readthedocs.io/en/stable/index.html) (not recommended, see
[mypy_issues](https://github.com/erictraut/mypy_issues))
For validation and testing, `scipy-stubs` primarily uses [`basedmypy`](https://github.com/KotlinIsland/basedmypy) (a `mypy` fork)
and [`basedpyright`](https://github.com/DetachHead/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.
## `scipy` coverage
The entire public API of `scipy` is **fully annotated** and **verifiably valid**.
For the most part, this can also be said about `scipy`'s private API and other internal machinery.
Note that this does not mean that all annotations are optimal, and some might even be incorrect. If you encounter this, it would
help a lot if you could open an issue or a PR for it.
## Contributing
There are many ways that you can help improve `scipy-stubs`, for example
- reporting issues, bugs, or other unexpected outcomes
- improving the `.pyi` stubs (see [CONTRIBUTING.md](https://github.com/scipy/scipy-stubs/blob/master/CONTRIBUTING.md))
- type-testing (see the `README.md` in [`scipy-stubs/tests`](https://github.com/scipy/scipy-stubs/tree/master/tests) for the
specifics)
- write new documentation (usage examples, guides, tips & tricks, FAQ, etc.), or e.g. improve this `README.md`
- help spread the word on `scipy-stubs`, so that more can benefit from using it
## AI generated Podcast
### Typing in SciPy
<https://github.com/user-attachments/assets/adbec640-2329-488b-bda2-d9687c6b1f7b>
## See also
- [scipy/scipy#21614](https://github.com/scipy/scipy/issues/21614): On why `scipy-stubs` is a separate package, and not part of
`scipy` (yet).
- [microsoft/python-type-stubs#321](https://github.com/microsoft/python-type-stubs/pull/321): The removal of Microsoft's
`scipy-stubs` — that used to be bundled with Pylance — in favor of `scipy-stubs`.
- [`optype`](https://github.com/jorenham/optype): The fundamental typing package that made `scipy-stubs` possible.
- [`basedpyright`](https://github.com/detachhead/basedpyright): The recommended type-checker to use with `scipy-stubs`.
- [`basedmypy`](https://github.com/KotlinIsland/basedmypy): A [less-broken](https://github.com/erictraut/mypy_issues) `mypy` fork,
with a bunch of cool extra features.
Raw data
{
"_id": null,
"home_page": null,
"name": "scipy-stubs",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "SciPy Developers <scipy-dev@python.org>, Joren Hammudoglu <jhammudoglu@gmail.com>",
"keywords": "pep484, scipy, typing",
"author": null,
"author_email": "Joren Hammudoglu <jhammudoglu@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/26/84/0e08774fe4339acf33305e34926663ef8993743df43a81e2097d3611b985/scipy_stubs-1.15.2.0.tar.gz",
"platform": null,
"description": "<h1 align=\"center\">scipy-stubs</h1>\n\n<p align=\"center\">\n Precise type hints for <i>all</i> of <a href=\"https://github.com/scipy/scipy\">SciPy</a>.\n</p>\n\n<p align=\"center\">\n <a href=\"https://pypi.org/project/scipy-stubs/\">\n <img\n alt=\"scipy-stubs - PyPI\"\n src=\"https://img.shields.io/pypi/v/scipy-stubs?style=flat&color=olive\"\n />\n </a>\n <a href=\"https://anaconda.org/conda-forge/scipy-stubs\">\n <img\n alt=\"scipy-stubs - conda-forge\"\n src=\"https://anaconda.org/conda-forge/scipy-stubs/badges/version.svg\"\n />\n </a>\n <a href=\"https://github.com/scipy/scipy-stubs\">\n <img\n alt=\"scipy-stubs - Python Versions\"\n src=\"https://img.shields.io/pypi/pyversions/scipy-stubs?style=flat\"\n />\n </a>\n <a href=\"https://github.com/scipy/scipy-stubs\">\n <img\n alt=\"scipy-stubs - license\"\n src=\"https://img.shields.io/github/license/scipy/scipy-stubs?style=flat\"\n />\n </a>\n</p>\n<p align=\"center\">\n <a href=\"https://github.com/scipy/scipy-stubs/actions?query=workflow%3ACI\">\n <img\n alt=\"scipy-stubs - CI\"\n src=\"https://github.com/scipy/scipy-stubs/workflows/CI/badge.svg\"\n />\n </a>\n <a href=\"https://github.com/pre-commit/pre-commit\">\n <img\n alt=\"scipy-stubs - pre-commit\"\n src=\"https://img.shields.io/badge/pre--commit-enabled-teal?logo=pre-commit\"\n />\n </a>\n <a href=\"https://github.com/KotlinIsland/basedmypy\">\n <img\n alt=\"scipy-stubs - basedmypy\"\n src=\"https://img.shields.io/badge/basedmypy-checked-fd9002\"\n />\n </a>\n <a href=\"https://detachhead.github.io/basedpyright\">\n <img\n alt=\"scipy-stubs - basedpyright\"\n src=\"https://img.shields.io/badge/basedpyright-checked-42b983\"\n />\n </a>\n <a href=\"https://github.com/astral-sh/ruff\">\n <img\n alt=\"scipy-stubs - ruff\"\n src=\"https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\"\n />\n </a>\n</p>\n\n______________________________________________________________________\n\n## Highlights\n\n- Works out-of-the-box\n - all that's needed is to [install `scipy-stubs`](#installation)\n - does not require a `mypy` plugin or other configuration\n - available on [PyPI](https://pypi.org/project/scipy-stubs/) and [conda-forge](https://anaconda.org/conda-forge/scipy-stubs)\n- Improves IDE suggestions and autocompletion\n - ... even if you don't use static typing in your code\n - no additional plugins required\n- 0% runtime overhead\n - not even a single import is required\n- 100% coverage of the [public SciPy API](https://docs.scipy.org/doc/scipy/reference/index.html)\n - also covers most of the private API\n- Precise type-hinting of dtypes and [shape-types](https://github.com/numpy/numpy/issues/16544)\n - works with all \"array-likes\" and \"dtype-likes\"\n - many of the functions that return an array are *shape-typed*\n - shape-typing is optional: all functions still accept arrays with unknown shape-type\n- Type-checker agnostic\n - works with at least [`mypy`](https://github.com/KotlinIsland/basedmypy),\n [`pyright`](https://github.com/DetachHead/basedpyright)/pylance and [`ruff`](https://github.com/astral-sh/ruff)\n - ... even in the strict mode\n - compatible with the [Python Typing Spec](https://typing.readthedocs.io/en/latest/spec/index.html)\n- [SPEC 0](https://scientific-python.org/specs/spec-0000/) compliant\n - Supports Python \u2265 3.10\n - Supports NumPy \u2265 1.23.5\n\n<!-- NOTE: SciPy permalinks to the following `#installation` anchor; don't modify it! -->\n\n## Installation\n\nThe source code is currently hosted on GitHub at [github.com/scipy/scipy-stubs](https://github.com/scipy/scipy-stubs/).\n\nBinary distributions are available at the [Python Package Index (PyPI)](https://pypi.org/project/scipy-stubs/) and on\n[conda-forge](https://anaconda.org/conda-forge/scipy-stubs).\n\n### Using pip (PyPI)\n\nTo install from the [PyPI](https://pypi.org/project/scipy-stubs/), run:\n\n```bash\npip install scipy-stubs\n```\n\nIn case you haven't installed `scipy` yet, both can be installed with:\n\n```bash\npip install scipy-stubs[scipy]\n```\n\n### Using conda (conda-forge)\n\nTo install using Conda from the [conda-forge channel](https://anaconda.org/conda-forge/scipy-stubs), run:\n\n```bash\nconda install conda-forge::scipy-stubs\n```\n\nIt's also possible to install both `scipy` and `scipy-stubs` together through the bundled\n[`scipy-typed`](https://anaconda.org/conda-forge/scipy-typed) package:\n\n```bash\nconda install conda-forge::scipy-typed\n```\n\n### Packages overview\n\n<table>\n <tr>\n <th rowspan=\"2\" colspan=\"2\"></th>\n <th colspan=\"2\">Python packages</th>\n </tr>\n <tr>\n <th><code>scipy-stubs</code></th>\n <th><code>scipy</code> + <code>scipy-stubs</code></td>\n </tr>\n <tr>\n <th>PyPI</th>\n <th align=\"right\"><code>pip install {}</code></th>\n <td><code>scipy-stubs</code></td>\n <td><code>scipy-stubs[scipy]</code></td>\n </tr>\n <tr>\n <th>conda-forge</th>\n <th align=\"right\"><code>conda install conda-forge::{}</code></th>\n <td><code>scipy-stubs</code></td>\n <td><code>scipy-typed</code></td>\n </tr>\n</table>\n\n## Versioning and requirements\n\nThe versioning scheme of `scipy-stubs` includes the compatible `scipy` version as `{scipy_version}.{stubs_version}`.\nEven though `scipy-stubs` doesn't enforce an upper bound on the `scipy` version, later `scipy` versions aren't guaranteed to be\nfully compatible.\n\nThere are no additional restrictions enforced by `scipy-stubs` on the `numpy` requirements.\nFor `scipy[-stubs]` `1.14.*` and `1.15.*` that is `numpy >= 1.23.5`.\n\nCurrently, `scipy-stubs` has one required dependency: [`optype`](https://github.com/jorenham/optype).\nThis is essential for `scipy-stubs` to work properly, as it relies heavily on it for annotating (shaped) array-likes,\nscalar-likes, shape-typing in general, and much more.\nAt the moment, `scipy-stubs` requires the latest version `optype`.\n\nThe exact version requirements are specified in the [`pyproject.toml`](pyproject.toml).\n\n## Supported static type-checkers\n\n1. [`basedpyright`](https://github.com/DetachHead/basedpyright) (recommended)\n1. [`basedmypy`](https://github.com/KotlinIsland/basedmypy)\n1. [`pyright`](https://pyright.readthedocs.io/en/latest/index.html)\n1. [`mypy`](https://mypy.readthedocs.io/en/stable/index.html) (not recommended, see\n [mypy_issues](https://github.com/erictraut/mypy_issues))\n\nFor validation and testing, `scipy-stubs` primarily uses [`basedmypy`](https://github.com/KotlinIsland/basedmypy) (a `mypy` fork)\nand [`basedpyright`](https://github.com/DetachHead/basedpyright) (a `pyright` fork).\nThey are in generally stricter than `mypy` and `pyright`, so you can assume compatibility with `mypy` and `pyright` as well.\nBut if you find that this isn't the case, then don't hesitate to open an issue or submit a pull request.\n\n## `scipy` coverage\n\nThe entire public API of `scipy` is **fully annotated** and **verifiably valid**.\nFor the most part, this can also be said about `scipy`'s private API and other internal machinery.\n\nNote that this does not mean that all annotations are optimal, and some might even be incorrect. If you encounter this, it would\nhelp a lot if you could open an issue or a PR for it.\n\n## Contributing\n\nThere are many ways that you can help improve `scipy-stubs`, for example\n\n- reporting issues, bugs, or other unexpected outcomes\n- improving the `.pyi` stubs (see [CONTRIBUTING.md](https://github.com/scipy/scipy-stubs/blob/master/CONTRIBUTING.md))\n- type-testing (see the `README.md` in [`scipy-stubs/tests`](https://github.com/scipy/scipy-stubs/tree/master/tests) for the\n specifics)\n- write new documentation (usage examples, guides, tips & tricks, FAQ, etc.), or e.g. improve this `README.md`\n- help spread the word on `scipy-stubs`, so that more can benefit from using it\n\n## AI generated Podcast\n\n### Typing in SciPy\n\n<https://github.com/user-attachments/assets/adbec640-2329-488b-bda2-d9687c6b1f7b>\n\n## See also\n\n- [scipy/scipy#21614](https://github.com/scipy/scipy/issues/21614): On why `scipy-stubs` is a separate package, and not part of\n `scipy` (yet).\n- [microsoft/python-type-stubs#321](https://github.com/microsoft/python-type-stubs/pull/321): The removal of Microsoft's\n `scipy-stubs` \u2014 that used to be bundled with Pylance \u2014 in favor of `scipy-stubs`.\n- [`optype`](https://github.com/jorenham/optype): The fundamental typing package that made `scipy-stubs` possible.\n- [`basedpyright`](https://github.com/detachhead/basedpyright): The recommended type-checker to use with `scipy-stubs`.\n- [`basedmypy`](https://github.com/KotlinIsland/basedmypy): A [less-broken](https://github.com/erictraut/mypy_issues) `mypy` fork,\n with a bunch of cool extra features.\n",
"bugtrack_url": null,
"license": null,
"summary": "Type annotations for SciPy",
"version": "1.15.2.0",
"project_urls": {
"Changelog": "https://github.com/scipy/scipy-stubs/releases",
"Homepage": "https://scipy.org/",
"Issues": "https://github.com/scipy/scipy-stubs/issues",
"Repository": "https://github.com/scipy/scipy-stubs/"
},
"split_keywords": [
"pep484",
" scipy",
" typing"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "9e818fa612c984f96edc3beeb35ad61c0229a6b8c2d0b87c3c80a5b17974b310",
"md5": "b6948eb5d995e29639c9a54e9d8f3b7d",
"sha256": "fb6eddf98184711402a8d25744729823dc909667ccaa64b45db4b26e50451843"
},
"downloads": -1,
"filename": "scipy_stubs-1.15.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b6948eb5d995e29639c9a54e9d8f3b7d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 457211,
"upload_time": "2025-02-17T05:04:43",
"upload_time_iso_8601": "2025-02-17T05:04:43.059724Z",
"url": "https://files.pythonhosted.org/packages/9e/81/8fa612c984f96edc3beeb35ad61c0229a6b8c2d0b87c3c80a5b17974b310/scipy_stubs-1.15.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "26840e08774fe4339acf33305e34926663ef8993743df43a81e2097d3611b985",
"md5": "b98ba6a4c1d48bb363afc5e93f313882",
"sha256": "d93b9d3fac23d28f7dadbe46a666e59ba7d269a7ac75de1939e5e73cec848b7d"
},
"downloads": -1,
"filename": "scipy_stubs-1.15.2.0.tar.gz",
"has_sig": false,
"md5_digest": "b98ba6a4c1d48bb363afc5e93f313882",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 273393,
"upload_time": "2025-02-17T05:04:44",
"upload_time_iso_8601": "2025-02-17T05:04:44.803620Z",
"url": "https://files.pythonhosted.org/packages/26/84/0e08774fe4339acf33305e34926663ef8993743df43a81e2097d3611b985/scipy_stubs-1.15.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-17 05:04:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "scipy",
"github_project": "scipy-stubs",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "scipy-stubs"
}