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 |
| 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 |
| 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
| """nptypes.py - Various useful types and type aliases""" | |
| # FUTURE: Integrate optype | |
| from typing import Any, Literal, Protocol, TypeAlias, TypeVar | |
| import numpy as np | |
| import numpy.typing as npt | |
| from typing_extensions import TypeIs |
| #!/usr/bin/env python3 | |
| import argparse | |
| import configparser | |
| import os | |
| import re | |
| import shlex | |
| import sys | |
| from typing import Any |
| #!/usr/bin/env python -u | |
| import os | |
| import re | |
| import sys | |
| import itertools | |
| import contextlib | |
| import subprocess | |
| sys.stdout.reconfigure(line_buffering=True) |