Name | scipy-stubs JSON |
Version |
1.14.1.5
JSON |
| download |
home_page | None |
Summary | Precise type-hints for all of SciPy |
upload_time | 2024-12-03 17:40:56 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | BSD-3-Clause |
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/jorenham/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/jorenham/scipy-stubs">
<img
alt="scipy-stubs - license"
src="https://img.shields.io/github/license/jorenham/scipy-stubs?style=flat"
/>
</a>
</p>
<p align="center">
<a href="https://github.com/jorenham/scipy-stubs/actions?query=workflow%3ACI">
<img
alt="scipy-stubs - CI"
src="https://github.com/jorenham/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-1.14.1/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.24
## Installation
<table>
<tr>
<th width="500px">PyPI</th>
<th width="500px">Conda</th>
</tr>
<tr>
<td>
```shell
pip install scipy-stubs
```
</td>
<td>
```shell
conda install conda-forge::scipy-stubs
```
</td>
</tr>
</table>
## 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 [erictraut/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.
## 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.
The supported range of `numpy` versions are specified in [`SPEC 0`](https://scientific-python.org/specs/spec-0000/), which
`scipy-stubs` aims to follow as close as feasible.
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).
## `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.
However, a small portion uses `Untyped` (an alias of `Any`) as "placeholder annotations".
In those cases static type-checkers won't do any type-checking, and won't bother you with errors or warnings.
The following table shows the (subjective) proportion of `scipy-stubs` that is(n't) annotated with `Untyped`, ranging
from 🌑 (100% `Untyped`) to 🌕 (0% `Untyped`).
| `scipy._` | `ruff` & `flake8-pyi` | `stubtest` | `basedmypy` | `basedpyright` | phase |
| :------------ | :-------------------: | :--------: | :---------: | :------------: | :---: |
| `cluster` | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| `constants` | ✔️ | ✔️ | ✔️ | ✔️ | 🌝 |
| `datasets` | ✔️ | ✔️ | ✔️ | ✔️ | 🌝 |
| `fft` | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| `fftpack` | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| `integrate` | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| `interpolate` | ✔️ | ✔️ | ✔️ | ✔️ | 🌓 |
| `io` | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| `linalg` | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| ~`misc`~ | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| `ndimage` | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| `odr` | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| `optimize` | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| `signal` | ✔️ | ✔️ | ✔️ | ✔️ | 🌔 |
| `sparse` | ✔️ | ✔️ | ✔️ | ✔️ | 🌒 |
| `spatial` | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| `special` | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| `stats` | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
| *`_lib`* | ✔️ | ✔️ | ✔️ | ✔️ | 🌕 |
Currently, only `interpolate`, `signal`, and `sparse` contain `Untyped` annotations.
## 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": null,
"keywords": "pep484, scipy, typing",
"author": null,
"author_email": "Joren Hammudoglu <jhammudoglu@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/2e/79/d9a73d6c215b00b21ed16c6638c72a2ea25392f44348bd512fb7802f2ec4/scipy_stubs-1.14.1.5.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/jorenham/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/jorenham/scipy-stubs\">\n <img\n alt=\"scipy-stubs - license\"\n src=\"https://img.shields.io/github/license/jorenham/scipy-stubs?style=flat\"\n />\n </a>\n</p>\n<p align=\"center\">\n <a href=\"https://github.com/jorenham/scipy-stubs/actions?query=workflow%3ACI\">\n <img\n alt=\"scipy-stubs - CI\"\n src=\"https://github.com/jorenham/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-1.14.1/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.24\n\n## Installation\n\n<table>\n\n<tr>\n <th width=\"500px\">PyPI</th>\n <th width=\"500px\">Conda</th>\n</tr>\n\n<tr>\n<td>\n\n```shell\npip install scipy-stubs\n```\n\n</td>\n<td>\n\n```shell\nconda install conda-forge::scipy-stubs\n```\n\n</td>\n</tr>\n\n</table>\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 [erictraut/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## 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\nThe supported range of `numpy` versions are specified in [`SPEC 0`](https://scientific-python.org/specs/spec-0000/), which\n`scipy-stubs` aims to follow as close as feasible.\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## `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\nHowever, a small portion uses `Untyped` (an alias of `Any`) as \"placeholder annotations\".\nIn those cases static type-checkers won't do any type-checking, and won't bother you with errors or warnings.\n\nThe following table shows the (subjective) proportion of `scipy-stubs` that is(n't) annotated with `Untyped`, ranging\nfrom \ud83c\udf11 (100% `Untyped`) to \ud83c\udf15 (0% `Untyped`).\n\n| `scipy._` | `ruff` & `flake8-pyi` | `stubtest` | `basedmypy` | `basedpyright` | phase |\n| :------------ | :-------------------: | :--------: | :---------: | :------------: | :---: |\n| `cluster` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| `constants` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf1d |\n| `datasets` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf1d |\n| `fft` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| `fftpack` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| `integrate` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| `interpolate` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf13 |\n| `io` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| `linalg` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| ~`misc`~ | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| `ndimage` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| `odr` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| `optimize` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| `signal` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf14 |\n| `sparse` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf12 |\n| `spatial` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| `special` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| `stats` | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n| *`_lib`* | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \u2714\ufe0f | \ud83c\udf15 |\n\nCurrently, only `interpolate`, `signal`, and `sparse` contain `Untyped` annotations.\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": "BSD-3-Clause",
"summary": "Precise type-hints for all of SciPy",
"version": "1.14.1.5",
"project_urls": {
"Changelog": "https://github.com/jorenham/scipy-stubs/releases",
"Funding": "https://github.com/sponsors/jorenham",
"Issues": "https://github.com/jorenham/scipy-stubs/issues",
"Repository": "https://github.com/jorenham/scipy-stubs/"
},
"split_keywords": [
"pep484",
" scipy",
" typing"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "5a01166738cea89ca8acacd46ef048b9ea37b5817373c7052bfaadbc6a95bc74",
"md5": "49ebb4c648c73f4410e3c0ece120f2ad",
"sha256": "ca927802cae4c83e75b2a4b8c41271f36ebe0d928cee25ef3968e143b1793a75"
},
"downloads": -1,
"filename": "scipy_stubs-1.14.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "49ebb4c648c73f4410e3c0ece120f2ad",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 386065,
"upload_time": "2024-12-03T17:40:54",
"upload_time_iso_8601": "2024-12-03T17:40:54.687140Z",
"url": "https://files.pythonhosted.org/packages/5a/01/166738cea89ca8acacd46ef048b9ea37b5817373c7052bfaadbc6a95bc74/scipy_stubs-1.14.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2e79d9a73d6c215b00b21ed16c6638c72a2ea25392f44348bd512fb7802f2ec4",
"md5": "6c03b7482d9e2c044171ac2650fcd63e",
"sha256": "66c160c6b72b1406edc7827879ef25ea81dc3d95ab7e4af3a2de836f27c26ce6"
},
"downloads": -1,
"filename": "scipy_stubs-1.14.1.5.tar.gz",
"has_sig": false,
"md5_digest": "6c03b7482d9e2c044171ac2650fcd63e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 211659,
"upload_time": "2024-12-03T17:40:56",
"upload_time_iso_8601": "2024-12-03T17:40:56.735056Z",
"url": "https://files.pythonhosted.org/packages/2e/79/d9a73d6c215b00b21ed16c6638c72a2ea25392f44348bd512fb7802f2ec4/scipy_stubs-1.14.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-03 17:40:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jorenham",
"github_project": "scipy-stubs",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "scipy-stubs"
}