Skip to content

Commit fe4a14f

Browse files
πŸ“ Add a highlights section in README.md (#249)
* πŸ“ Add a highlights section in `README.md` * πŸ“ "Anaconda" -> "conda-forge" Co-authored-by: Lucas Colley <[email protected]> * πŸ“ Fix typo --------- Co-authored-by: Lucas Colley <[email protected]>
1 parent cf64a95 commit fe4a14f

File tree

1 file changed

+56
-30
lines changed

1 file changed

+56
-30
lines changed

β€ŽREADME.mdβ€Ž

Lines changed: 56 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<h1 align="center">scipy-stubs</h1>
22

33
<p align="center">
4-
Typing stubs for <a href="https://github.com/scipy/scipy">SciPy</a>.
4+
Precise type hints for <i>all</i> of <a href="https://github.com/scipy/scipy">SciPy</a>.
55
</p>
66

77
<p align="center">
@@ -65,6 +65,32 @@
6565

6666
______________________________________________________________________
6767

68+
## Highlights
69+
70+
- Works out-of-the-box
71+
- all that's needed is to [install `scipy-stubs`](#installation)
72+
- does not require a `mypy` plugin or other configuration
73+
- available on [PyPI](https://pypi.org/project/scipy-stubs/) and [conda-forge](https://anaconda.org/conda-forge/scipy-stubs)
74+
- Improves IDE suggestions and autocompletion
75+
- ... even if you don't use static typing in your code
76+
- no additional plugins required
77+
- 0% runtime overhead
78+
- not even a single import is required
79+
- 100% coverage of the [public SciPy API](https://docs.scipy.org/doc/scipy-1.14.1/reference/index.html)
80+
- also covers most of the private API
81+
- Precise type-hinting of dtypes and [shape-types](https://github.com/numpy/numpy/issues/16544)
82+
- works with all "array-likes" and "dtype-likes"
83+
- many of the functions that return an array are *shape-typed*
84+
- shape-typing is optional: all functions still accept arrays with unknown shape-type
85+
- Type-checker agnostic
86+
- works with at least [`mypy`](https://github.com/KotlinIsland/basedmypy),
87+
[`pyright`](https://github.com/DetachHead/basedpyright)/pylance and [`ruff`](https://github.com/astral-sh/ruff)
88+
- ... even in the strict mode
89+
- compatible with the [Python Typing Spec](https://typing.readthedocs.io/en/latest/spec/index.html)
90+
- [SPEC 0](https://scientific-python.org/specs/spec-0000/) compliant
91+
- Supports Python β‰₯ 3.10
92+
- Supports NumPy β‰₯ 1.24
93+
6894
## Installation
6995

7096
<table>
@@ -93,12 +119,40 @@ conda install conda-forge::scipy-stubs
93119

94120
</table>
95121

122+
## Supported static type-checkers
123+
124+
1. [`basedpyright`](https://github.com/DetachHead/basedpyright) (recommended)
125+
1. [`basedmypy`](https://github.com/KotlinIsland/basedmypy)
126+
1. [`pyright`](https://pyright.readthedocs.io/en/latest/index.html)
127+
1. [`mypy`](https://mypy.readthedocs.io/en/stable/index.html) (not recommended, see [erictraut/mypy_issues](https://github.com/erictraut/mypy_issues))
128+
129+
For validation and testing, `scipy-stubs` primarily uses [`basedmypy`](https://github.com/KotlinIsland/basedmypy) (a `mypy` fork)
130+
and [`basedpyright`](https://github.com/DetachHead/basedpyright) (a `pyright` fork).
131+
They are in generally stricter than `mypy` and `pyright`, so you can assume compatibility with `mypy` and `pyright` as well.
132+
But if you find that this isn't the case, then don't hesitate to open an issue or submit a pull request.
133+
134+
## Versioning and requirements
135+
136+
The versioning scheme of `scipy-stubs` includes the compatible `scipy` version as `{scipy_version}.{stubs_version}`.
137+
Even though `scipy-stubs` doesn't enforce an upper bound on the `scipy` version, later `scipy` versions aren't guaranteed to be
138+
fully compatible.
139+
140+
The supported range of `numpy` versions are specified in [`SPEC 0`](https://scientific-python.org/specs/spec-0000/), which
141+
`scipy-stubs` aims to follow as close as feasible.
142+
143+
Currently, `scipy-stubs` has one required dependency: [`optype`](https://github.com/jorenham/optype).
144+
This is essential for `scipy-stubs` to work properly, as it relies heavily on it for annotating (shaped) array-likes,
145+
scalar-likes, shape-typing in general, and much more.
146+
At the moment, `scipy-stubs` requires the latest version `optype`.
147+
148+
The exact version requirements are specified in the [`pyproject.toml`](pyproject.toml).
149+
96150
## `scipy` coverage
97151

98152
The entire public API of `scipy` is **fully annotated** and **verifiably valid**.
99153
For the most part, this can also be said about `scipy`'s private API and other internal machinery.
100154

101-
However, a small portion uses `Untyped` (and alias of `Any`) as "placeholder annotations".
155+
However, a small portion uses `Untyped` (an alias of `Any`) as "placeholder annotations".
102156
In those cases static type-checkers won't do any type-checking, and won't bother you with errors or warnings.
103157

104158
The following table shows the (subjective) proportion of `scipy-stubs` that is(n't) annotated with `Untyped`, ranging
@@ -126,34 +180,6 @@ from πŸŒ‘ (100% `Untyped`) to πŸŒ• (0% `Untyped`).
126180
| `stats` | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | πŸŒ• |
127181
| *`_lib`* | βœ”οΈ | βœ”οΈ | βœ”οΈ | βœ”οΈ | πŸŒ• |
128182

129-
## Supported static type-checkers
130-
131-
1. [`basedpyright`](https://github.com/DetachHead/basedpyright) (recommended)
132-
1. [`basedmypy`](https://github.com/KotlinIsland/basedmypy)
133-
1. [`pyright`](https://pyright.readthedocs.io/en/latest/index.html)
134-
1. [`mypy`](https://mypy.readthedocs.io/en/stable/index.html) (not recommended, see [erictraut/mypy_issues](https://github.com/erictraut/mypy_issues))
135-
136-
For validation and testing, `scipy-stubs` primarily uses [`basedmypy`](https://github.com/KotlinIsland/basedmypy) (a `mypy` fork)
137-
and [`basedpyright`](https://github.com/DetachHead/basedpyright) (a `pyright` fork).
138-
They are in generally stricter than `mypy` and `pyright`, so you can assume compatibility with `mypy` and `pyright` as well.
139-
But if you find that this isn't the case, then don't hesitate to open an issue or submit a pull request.
140-
141-
## Versioning and requirements
142-
143-
The versioning scheme of `scipy-stubs` includes the compatible `scipy` version as `{scipy_version}.{stubs_version}`.
144-
Even though `scipy-stubs` doesn't enforce an upper bound on the `scipy` version, later `scipy` versions aren't guaranteed to be
145-
fully compatible.
146-
147-
The supported range of `numpy` versions are specified in [`SPEC 0`](https://scientific-python.org/specs/spec-0000/), which
148-
`scipy-stubs` aims to follow as close as feasible.
149-
150-
Currently, `scipy-stubs` has one required dependency: [`optype`](https://github.com/jorenham/optype).
151-
This is essential for `scipy-stubs` to work properly, as it relies heavily on it for annotating (shaped) array-likes,
152-
scalar-likes, shape-typing in general, and much more.
153-
At the moment, `scipy-stubs` requires the latest version `optype`.
154-
155-
The exact version requirements are specified in the [`pyproject.toml`](pyproject.toml).
156-
157183
## See also
158184

159185
- [scipy/scipy#21614](https://github.com/scipy/scipy/issues/21614): On why `scipy-stubs` is a separate package, and not part of

0 commit comments

Comments
Β (0)