Rank-typing coverage of the public NumPy API.
| Function | Progress | Effort | Limit | Uses (x1000) |
|---|---|---|---|---|
array |
● | 20,218 | ||
arange |
● | 10,060 | ||
zeros[^shapearg] |
● | 9,716 | ||
ones[^shapearg] |
● | 6,676 |
| note: unused allowlist entry scipy\._lib\.(array_api_(compat|extra)|cobyqa|pyprima).* | |
| note: unused allowlist entry scipy\.fft\._pocketfft\..* | |
| scipy.__all__ | |
| scipy._lib._array_api.__all__ | |
| scipy._lib._array_api.array_namespace | |
| scipy._lib._array_api.is_pydata_sparse_array | |
| scipy._lib._array_api.make_xp_pytest_param | |
| scipy._lib._array_api.xp_capabilities | |
| scipy._lib._array_api_compat_vendor | |
| scipy._lib._array_api_docs_tables.is_inherently_out_of_scope |
| from typing import Protocol, Literal, reveal_type | |
| class CanRMul[InT, OutT](Protocol): | |
| def __rmul__(self, other: InT, /) -> OutT: ... | |
| def twice[OutT](x: CanRMul[Literal[2], OutT]) -> OutT: | |
| return 2 * x |
| { | |
| "label": "", | |
| "message": "ty", | |
| "logoSvg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"48\" height=\"48\"><path d=\"M48 7.7H27.8V0h-24v7.7H0v18.2h3.8v14.3c0 4.3 3.5 7.8 7.8 7.8H48V29.8H27.8v-3.9h12.4c4.3 0 7.8-3.5 7.8-7.8V7.7Z\" fill=\"#46ebe1\"/></svg>", | |
| "logoWidth": 10, | |
| "labelColor": "grey", | |
| "color": "#261230" | |
| } |
| module | usage_count | |
|---|---|---|
| scipy.stats | 1556 | |
| scipy.signal | 1506 | |
| scipy.linalg | 1342 | |
| scipy.optimize | 1319 | |
| scipy.sparse | 748 | |
| scipy.interpolate | 497 | |
| scipy.special | 441 | |
| scipy.ndimage | 434 | |
| scipy.spatial | 417 |
| trait Family { | |
| type Member<T>; | |
| } | |
| trait Functor<A> { | |
| type Of: Family<Member<A> = Self>; | |
| fn fmap<B>(self, f: impl FnMut(A) -> B) -> <Self::Of as Family>::Member<B>; | |
| } | |
| // |
| import subprocess | |
| from pathlib import Path | |
| # see https://github.com/astral-sh/ruff/pull/18224 | |
| from ruff.__main__ import ( # type: ignore[import-untyped] # pyright: ignore[reportMissingTypeStubs] | |
| find_ruff_bin, # noqa: PLC2701 | |
| ) | |
| def ruff_format(source: str) -> str: |
original post: scipy/scipy-stubs#153 (comment)
Overloads are roughly similar to pattern matching[^1], but from the perspective of the caller.
Consider this function for example