Initial configuration commit

This commit is contained in:
Alex Selimov 2023-10-24 22:54:55 -04:00
commit 31c8abea59
266 changed files with 780274 additions and 0 deletions

View file

@ -0,0 +1,33 @@
"""
This type stub file was generated by pyright.
"""
import math as math
from typing import Any
from numpy._pytesttester import PytestTester
from numpy import ndenumerate as ndenumerate, ndindex as ndindex
from numpy.version import version
from numpy.lib import format as format, mixins as mixins, scimath as scimath, stride_tricks as stride_tricks
from numpy.lib._version import NumpyVersion as NumpyVersion
from numpy.lib.arraypad import pad as pad
from numpy.lib.arraysetops import ediff1d as ediff1d, in1d as in1d, intersect1d as intersect1d, isin as isin, setdiff1d as setdiff1d, setxor1d as setxor1d, union1d as union1d, unique as unique
from numpy.lib.arrayterator import Arrayterator as Arrayterator
from numpy.lib.function_base import add_docstring as add_docstring, add_newdoc as add_newdoc, add_newdoc_ufunc as add_newdoc_ufunc, angle as angle, append as append, asarray_chkfinite as asarray_chkfinite, average as average, bartlett as bartlett, bincount as bincount, blackman as blackman, copy as copy, corrcoef as corrcoef, cov as cov, delete as delete, diff as diff, digitize as digitize, disp as disp, extract as extract, flip as flip, gradient as gradient, hamming as hamming, hanning as hanning, i0 as i0, insert as insert, interp as interp, iterable as iterable, kaiser as kaiser, median as median, meshgrid as meshgrid, percentile as percentile, piecewise as piecewise, place as place, quantile as quantile, rot90 as rot90, select as select, sinc as sinc, sort_complex as sort_complex, trapz as trapz, trim_zeros as trim_zeros, unwrap as unwrap, vectorize as vectorize
from numpy.lib.histograms import histogram as histogram, histogram_bin_edges as histogram_bin_edges, histogramdd as histogramdd
from numpy.lib.index_tricks import c_ as c_, diag_indices as diag_indices, diag_indices_from as diag_indices_from, fill_diagonal as fill_diagonal, index_exp as index_exp, ix_ as ix_, mgrid as mgrid, ogrid as ogrid, r_ as r_, ravel_multi_index as ravel_multi_index, s_ as s_, unravel_index as unravel_index
from numpy.lib.nanfunctions import nanargmax as nanargmax, nanargmin as nanargmin, nancumprod as nancumprod, nancumsum as nancumsum, nanmax as nanmax, nanmean as nanmean, nanmedian as nanmedian, nanmin as nanmin, nanpercentile as nanpercentile, nanprod as nanprod, nanquantile as nanquantile, nanstd as nanstd, nansum as nansum, nanvar as nanvar
from numpy.lib.npyio import DataSource as DataSource, fromregex as fromregex, genfromtxt as genfromtxt, load as load, loadtxt as loadtxt, packbits as packbits, recfromcsv as recfromcsv, recfromtxt as recfromtxt, save as save, savetxt as savetxt, savez as savez, savez_compressed as savez_compressed, unpackbits as unpackbits
from numpy.lib.polynomial import RankWarning as RankWarning, poly as poly, poly1d as poly1d, polyadd as polyadd, polyder as polyder, polydiv as polydiv, polyfit as polyfit, polyint as polyint, polymul as polymul, polysub as polysub, polyval as polyval, roots as roots
from numpy.lib.shape_base import apply_along_axis as apply_along_axis, apply_over_axes as apply_over_axes, array_split as array_split, column_stack as column_stack, dsplit as dsplit, dstack as dstack, expand_dims as expand_dims, get_array_wrap as get_array_wrap, hsplit as hsplit, kron as kron, put_along_axis as put_along_axis, row_stack as row_stack, split as split, take_along_axis as take_along_axis, tile as tile, vsplit as vsplit
from numpy.lib.stride_tricks import broadcast_arrays as broadcast_arrays, broadcast_shapes as broadcast_shapes, broadcast_to as broadcast_to
from numpy.lib.twodim_base import diag as diag, diagflat as diagflat, eye as eye, fliplr as fliplr, flipud as flipud, histogram2d as histogram2d, mask_indices as mask_indices, tri as tri, tril as tril, tril_indices as tril_indices, tril_indices_from as tril_indices_from, triu as triu, triu_indices as triu_indices, triu_indices_from as triu_indices_from, vander as vander
from numpy.lib.type_check import asfarray as asfarray, common_type as common_type, imag as imag, iscomplex as iscomplex, iscomplexobj as iscomplexobj, isreal as isreal, isrealobj as isrealobj, mintypecode as mintypecode, nan_to_num as nan_to_num, real as real, real_if_close as real_if_close, typename as typename
from numpy.lib.ufunclike import fix as fix, isneginf as isneginf, isposinf as isposinf
from numpy.lib.utils import byte_bounds as byte_bounds, deprecate as deprecate, deprecate_with_doc as deprecate_with_doc, get_include as get_include, info as info, issubclass_ as issubclass_, issubdtype as issubdtype, issubsctype as issubsctype, lookfor as lookfor, safe_eval as safe_eval, show_runtime as show_runtime, source as source, who as who
from numpy.core.multiarray import tracemalloc_domain as tracemalloc_domain
__all__: list[str]
__path__: list[str]
test: PytestTester
__version__ = ...
emath = scimath

View file

@ -0,0 +1,36 @@
"""
This type stub file was generated by pyright.
"""
__all__: list[str]
class NumpyVersion:
vstring: str
version: str
major: int
minor: int
bugfix: int
pre_release: str
is_devversion: bool
def __init__(self, vstring: str) -> None:
...
def __lt__(self, other: str | NumpyVersion) -> bool:
...
def __le__(self, other: str | NumpyVersion) -> bool:
...
def __eq__(self, other: str | NumpyVersion) -> bool:
...
def __ne__(self, other: str | NumpyVersion) -> bool:
...
def __gt__(self, other: str | NumpyVersion) -> bool:
...
def __ge__(self, other: str | NumpyVersion) -> bool:
...

View file

@ -0,0 +1,33 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, Literal as L, Protocol, TypeVar, overload
from numpy import generic
from numpy._typing import ArrayLike, NDArray, _ArrayLike, _ArrayLikeInt
_SCT = TypeVar("_SCT", bound=generic)
class _ModeFunc(Protocol):
def __call__(self, vector: NDArray[Any], iaxis_pad_width: tuple[int, int], iaxis: int, kwargs: dict[str, Any], /) -> None:
...
_ModeKind = L["constant", "edge", "linear_ramp", "maximum", "mean", "median", "minimum", "reflect", "symmetric", "wrap", "empty",]
__all__: list[str]
@overload
def pad(array: _ArrayLike[_SCT], pad_width: _ArrayLikeInt, mode: _ModeKind = ..., *, stat_length: None | _ArrayLikeInt = ..., constant_values: ArrayLike = ..., end_values: ArrayLike = ..., reflect_type: L["odd", "even"] = ...) -> NDArray[_SCT]:
...
@overload
def pad(array: ArrayLike, pad_width: _ArrayLikeInt, mode: _ModeKind = ..., *, stat_length: None | _ArrayLikeInt = ..., constant_values: ArrayLike = ..., end_values: ArrayLike = ..., reflect_type: L["odd", "even"] = ...) -> NDArray[Any]:
...
@overload
def pad(array: _ArrayLike[_SCT], pad_width: _ArrayLikeInt, mode: _ModeFunc, **kwargs: Any) -> NDArray[_SCT]:
...
@overload
def pad(array: ArrayLike, pad_width: _ArrayLikeInt, mode: _ModeFunc, **kwargs: Any) -> NDArray[Any]:
...

View file

@ -0,0 +1,142 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, Literal as L, SupportsIndex, TypeVar, overload
from numpy import bool_, byte, bytes_, cdouble, clongdouble, csingle, datetime64, double, generic, half, int8, int_, intc, intp, longdouble, longlong, number, object_, short, single, str_, timedelta64, ubyte, uint, uintc, ulonglong, ushort, void
from numpy._typing import ArrayLike, NDArray, _ArrayLike, _ArrayLikeBool_co, _ArrayLikeDT64_co, _ArrayLikeNumber_co, _ArrayLikeObject_co, _ArrayLikeTD64_co
_SCT = TypeVar("_SCT", bound=generic)
_NumberType = TypeVar("_NumberType", bound=number[Any])
_SCTNoCast = TypeVar("_SCTNoCast", bool_, ushort, ubyte, uintc, uint, ulonglong, short, byte, intc, int_, longlong, half, single, double, longdouble, csingle, cdouble, clongdouble, timedelta64, datetime64, object_, str_, bytes_, void)
__all__: list[str]
@overload
def ediff1d(ary: _ArrayLikeBool_co, to_end: None | ArrayLike = ..., to_begin: None | ArrayLike = ...) -> NDArray[int8]:
...
@overload
def ediff1d(ary: _ArrayLike[_NumberType], to_end: None | ArrayLike = ..., to_begin: None | ArrayLike = ...) -> NDArray[_NumberType]:
...
@overload
def ediff1d(ary: _ArrayLikeNumber_co, to_end: None | ArrayLike = ..., to_begin: None | ArrayLike = ...) -> NDArray[Any]:
...
@overload
def ediff1d(ary: _ArrayLikeDT64_co | _ArrayLikeTD64_co, to_end: None | ArrayLike = ..., to_begin: None | ArrayLike = ...) -> NDArray[timedelta64]:
...
@overload
def ediff1d(ary: _ArrayLikeObject_co, to_end: None | ArrayLike = ..., to_begin: None | ArrayLike = ...) -> NDArray[object_]:
...
@overload
def unique(ar: _ArrayLike[_SCT], return_index: L[False] = ..., return_inverse: L[False] = ..., return_counts: L[False] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> NDArray[_SCT]:
...
@overload
def unique(ar: ArrayLike, return_index: L[False] = ..., return_inverse: L[False] = ..., return_counts: L[False] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> NDArray[Any]:
...
@overload
def unique(ar: _ArrayLike[_SCT], return_index: L[True] = ..., return_inverse: L[False] = ..., return_counts: L[False] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[_SCT], NDArray[intp]]:
...
@overload
def unique(ar: ArrayLike, return_index: L[True] = ..., return_inverse: L[False] = ..., return_counts: L[False] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[Any], NDArray[intp]]:
...
@overload
def unique(ar: _ArrayLike[_SCT], return_index: L[False] = ..., return_inverse: L[True] = ..., return_counts: L[False] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[_SCT], NDArray[intp]]:
...
@overload
def unique(ar: ArrayLike, return_index: L[False] = ..., return_inverse: L[True] = ..., return_counts: L[False] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[Any], NDArray[intp]]:
...
@overload
def unique(ar: _ArrayLike[_SCT], return_index: L[False] = ..., return_inverse: L[False] = ..., return_counts: L[True] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[_SCT], NDArray[intp]]:
...
@overload
def unique(ar: ArrayLike, return_index: L[False] = ..., return_inverse: L[False] = ..., return_counts: L[True] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[Any], NDArray[intp]]:
...
@overload
def unique(ar: _ArrayLike[_SCT], return_index: L[True] = ..., return_inverse: L[True] = ..., return_counts: L[False] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[_SCT], NDArray[intp], NDArray[intp]]:
...
@overload
def unique(ar: ArrayLike, return_index: L[True] = ..., return_inverse: L[True] = ..., return_counts: L[False] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[Any], NDArray[intp], NDArray[intp]]:
...
@overload
def unique(ar: _ArrayLike[_SCT], return_index: L[True] = ..., return_inverse: L[False] = ..., return_counts: L[True] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[_SCT], NDArray[intp], NDArray[intp]]:
...
@overload
def unique(ar: ArrayLike, return_index: L[True] = ..., return_inverse: L[False] = ..., return_counts: L[True] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[Any], NDArray[intp], NDArray[intp]]:
...
@overload
def unique(ar: _ArrayLike[_SCT], return_index: L[False] = ..., return_inverse: L[True] = ..., return_counts: L[True] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[_SCT], NDArray[intp], NDArray[intp]]:
...
@overload
def unique(ar: ArrayLike, return_index: L[False] = ..., return_inverse: L[True] = ..., return_counts: L[True] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[Any], NDArray[intp], NDArray[intp]]:
...
@overload
def unique(ar: _ArrayLike[_SCT], return_index: L[True] = ..., return_inverse: L[True] = ..., return_counts: L[True] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[_SCT], NDArray[intp], NDArray[intp], NDArray[intp]]:
...
@overload
def unique(ar: ArrayLike, return_index: L[True] = ..., return_inverse: L[True] = ..., return_counts: L[True] = ..., axis: None | SupportsIndex = ..., *, equal_nan: bool = ...) -> tuple[NDArray[Any], NDArray[intp], NDArray[intp], NDArray[intp]]:
...
@overload
def intersect1d(ar1: _ArrayLike[_SCTNoCast], ar2: _ArrayLike[_SCTNoCast], assume_unique: bool = ..., return_indices: L[False] = ...) -> NDArray[_SCTNoCast]:
...
@overload
def intersect1d(ar1: ArrayLike, ar2: ArrayLike, assume_unique: bool = ..., return_indices: L[False] = ...) -> NDArray[Any]:
...
@overload
def intersect1d(ar1: _ArrayLike[_SCTNoCast], ar2: _ArrayLike[_SCTNoCast], assume_unique: bool = ..., return_indices: L[True] = ...) -> tuple[NDArray[_SCTNoCast], NDArray[intp], NDArray[intp]]:
...
@overload
def intersect1d(ar1: ArrayLike, ar2: ArrayLike, assume_unique: bool = ..., return_indices: L[True] = ...) -> tuple[NDArray[Any], NDArray[intp], NDArray[intp]]:
...
@overload
def setxor1d(ar1: _ArrayLike[_SCTNoCast], ar2: _ArrayLike[_SCTNoCast], assume_unique: bool = ...) -> NDArray[_SCTNoCast]:
...
@overload
def setxor1d(ar1: ArrayLike, ar2: ArrayLike, assume_unique: bool = ...) -> NDArray[Any]:
...
def in1d(ar1: ArrayLike, ar2: ArrayLike, assume_unique: bool = ..., invert: bool = ...) -> NDArray[bool_]:
...
def isin(element: ArrayLike, test_elements: ArrayLike, assume_unique: bool = ..., invert: bool = ..., *, kind: None | str = ...) -> NDArray[bool_]:
...
@overload
def union1d(ar1: _ArrayLike[_SCTNoCast], ar2: _ArrayLike[_SCTNoCast]) -> NDArray[_SCTNoCast]:
...
@overload
def union1d(ar1: ArrayLike, ar2: ArrayLike) -> NDArray[Any]:
...
@overload
def setdiff1d(ar1: _ArrayLike[_SCTNoCast], ar2: _ArrayLike[_SCTNoCast], assume_unique: bool = ...) -> NDArray[_SCTNoCast]:
...
@overload
def setdiff1d(ar1: ArrayLike, ar2: ArrayLike, assume_unique: bool = ...) -> NDArray[Any]:
...

View file

@ -0,0 +1,47 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Generator
from typing import Any, TypeVar, Union, overload
from numpy import dtype, generic, ndarray
from numpy._typing import DTypeLike
_Shape = TypeVar("_Shape", bound=Any)
_DType = TypeVar("_DType", bound=dtype[Any])
_ScalarType = TypeVar("_ScalarType", bound=generic)
_Index = Union[Union[ellipsis, int, slice], tuple[Union[ellipsis, int, slice], ...],]
__all__: list[str]
class Arrayterator(ndarray[_Shape, _DType]):
var: ndarray[_Shape, _DType]
buf_size: None | int
start: list[int]
stop: list[int]
step: list[int]
@property
def shape(self) -> tuple[int, ...]:
...
@property
def flat(self: ndarray[Any, dtype[_ScalarType]]) -> Generator[_ScalarType, None, None]:
...
def __init__(self, var: ndarray[_Shape, _DType], buf_size: None | int = ...) -> None:
...
@overload
def __array__(self, dtype: None = ...) -> ndarray[Any, _DType]:
...
@overload
def __array__(self, dtype: DTypeLike) -> ndarray[Any, dtype[Any]]:
...
def __getitem__(self, index: _Index) -> Arrayterator[Any, _DType]:
...
def __iter__(self) -> Generator[ndarray[Any, _DType], None, None]:
...

View file

@ -0,0 +1,48 @@
"""
This type stub file was generated by pyright.
"""
from typing import Final, Literal
__all__: list[str]
EXPECTED_KEYS: Final[set[str]]
MAGIC_PREFIX: Final[bytes]
MAGIC_LEN: Literal[8]
ARRAY_ALIGN: Literal[64]
BUFFER_SIZE: Literal[262144]
def magic(major, minor):
...
def read_magic(fp):
...
def dtype_to_descr(dtype):
...
def descr_to_dtype(descr):
...
def header_data_from_array_1_0(array):
...
def write_array_header_1_0(fp, d):
...
def write_array_header_2_0(fp, d):
...
def read_array_header_1_0(fp):
...
def read_array_header_2_0(fp):
...
def write_array(fp, array, version=..., allow_pickle=..., pickle_kwargs=...):
...
def read_array(fp, allow_pickle=..., pickle_kwargs=...):
...
def open_memmap(filename, mode=..., dtype=..., shape=..., fortran_order=..., version=...):
...

View file

@ -0,0 +1,382 @@
"""
This type stub file was generated by pyright.
"""
import sys
from collections.abc import Callable, Iterable, Iterator, Sequence
from typing import Any, Literal as L, Protocol, SupportsIndex, SupportsInt, TypeGuard, TypeVar, overload
from numpy import _OrderKACF, complex128, complexfloating, datetime64, float64, floating, generic, intp, object_, timedelta64, ufunc
from numpy._typing import ArrayLike, DTypeLike, NDArray, _ArrayLike, _ArrayLikeComplex_co, _ArrayLikeDT64_co, _ArrayLikeFloat_co, _ArrayLikeInt_co, _ArrayLikeObject_co, _ArrayLikeTD64_co, _ComplexLike_co, _DTypeLike, _FloatLike_co, _ScalarLike_co, _ShapeLike
if sys.version_info >= (3, 10):
...
else:
...
_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
_SCT = TypeVar("_SCT", bound=generic)
_ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
_2Tuple = tuple[_T, _T]
class _TrimZerosSequence(Protocol[_T_co]):
def __len__(self) -> int:
...
def __getitem__(self, key: slice, /) -> _T_co:
...
def __iter__(self) -> Iterator[Any]:
...
class _SupportsWriteFlush(Protocol):
def write(self, s: str, /) -> object:
...
def flush(self) -> object:
...
__all__: list[str]
def add_newdoc_ufunc(ufunc: ufunc, new_docstring: str, /) -> None:
...
@overload
def rot90(m: _ArrayLike[_SCT], k: int = ..., axes: tuple[int, int] = ...) -> NDArray[_SCT]:
...
@overload
def rot90(m: ArrayLike, k: int = ..., axes: tuple[int, int] = ...) -> NDArray[Any]:
...
@overload
def flip(m: _SCT, axis: None = ...) -> _SCT:
...
@overload
def flip(m: _ScalarLike_co, axis: None = ...) -> Any:
...
@overload
def flip(m: _ArrayLike[_SCT], axis: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def flip(m: ArrayLike, axis: None | _ShapeLike = ...) -> NDArray[Any]:
...
def iterable(y: object) -> TypeGuard[Iterable[Any]]:
...
@overload
def average(a: _ArrayLikeFloat_co, axis: None = ..., weights: None | _ArrayLikeFloat_co = ..., returned: L[False] = ..., keepdims: L[False] = ...) -> floating[Any]:
...
@overload
def average(a: _ArrayLikeComplex_co, axis: None = ..., weights: None | _ArrayLikeComplex_co = ..., returned: L[False] = ..., keepdims: L[False] = ...) -> complexfloating[Any, Any]:
...
@overload
def average(a: _ArrayLikeObject_co, axis: None = ..., weights: None | Any = ..., returned: L[False] = ..., keepdims: L[False] = ...) -> Any:
...
@overload
def average(a: _ArrayLikeFloat_co, axis: None = ..., weights: None | _ArrayLikeFloat_co = ..., returned: L[True] = ..., keepdims: L[False] = ...) -> _2Tuple[floating[Any]]:
...
@overload
def average(a: _ArrayLikeComplex_co, axis: None = ..., weights: None | _ArrayLikeComplex_co = ..., returned: L[True] = ..., keepdims: L[False] = ...) -> _2Tuple[complexfloating[Any, Any]]:
...
@overload
def average(a: _ArrayLikeObject_co, axis: None = ..., weights: None | Any = ..., returned: L[True] = ..., keepdims: L[False] = ...) -> _2Tuple[Any]:
...
@overload
def average(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., weights: None | Any = ..., returned: L[False] = ..., keepdims: bool = ...) -> Any:
...
@overload
def average(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., weights: None | Any = ..., returned: L[True] = ..., keepdims: bool = ...) -> _2Tuple[Any]:
...
@overload
def asarray_chkfinite(a: _ArrayLike[_SCT], dtype: None = ..., order: _OrderKACF = ...) -> NDArray[_SCT]:
...
@overload
def asarray_chkfinite(a: object, dtype: None = ..., order: _OrderKACF = ...) -> NDArray[Any]:
...
@overload
def asarray_chkfinite(a: Any, dtype: _DTypeLike[_SCT], order: _OrderKACF = ...) -> NDArray[_SCT]:
...
@overload
def asarray_chkfinite(a: Any, dtype: DTypeLike, order: _OrderKACF = ...) -> NDArray[Any]:
...
@overload
def piecewise(x: _ArrayLike[_SCT], condlist: ArrayLike, funclist: Sequence[Any | Callable[..., Any]], *args: Any, **kw: Any) -> NDArray[_SCT]:
...
@overload
def piecewise(x: ArrayLike, condlist: ArrayLike, funclist: Sequence[Any | Callable[..., Any]], *args: Any, **kw: Any) -> NDArray[Any]:
...
def select(condlist: Sequence[ArrayLike], choicelist: Sequence[ArrayLike], default: ArrayLike = ...) -> NDArray[Any]:
...
@overload
def copy(a: _ArrayType, order: _OrderKACF, subok: L[True]) -> _ArrayType:
...
@overload
def copy(a: _ArrayType, order: _OrderKACF = ..., *, subok: L[True]) -> _ArrayType:
...
@overload
def copy(a: _ArrayLike[_SCT], order: _OrderKACF = ..., subok: L[False] = ...) -> NDArray[_SCT]:
...
@overload
def copy(a: ArrayLike, order: _OrderKACF = ..., subok: L[False] = ...) -> NDArray[Any]:
...
def gradient(f: ArrayLike, *varargs: ArrayLike, axis: None | _ShapeLike = ..., edge_order: L[1, 2] = ...) -> Any:
...
@overload
def diff(a: _T, n: L[0], axis: SupportsIndex = ..., prepend: ArrayLike = ..., append: ArrayLike = ...) -> _T:
...
@overload
def diff(a: ArrayLike, n: int = ..., axis: SupportsIndex = ..., prepend: ArrayLike = ..., append: ArrayLike = ...) -> NDArray[Any]:
...
@overload
def interp(x: _ArrayLikeFloat_co, xp: _ArrayLikeFloat_co, fp: _ArrayLikeFloat_co, left: None | _FloatLike_co = ..., right: None | _FloatLike_co = ..., period: None | _FloatLike_co = ...) -> NDArray[float64]:
...
@overload
def interp(x: _ArrayLikeFloat_co, xp: _ArrayLikeFloat_co, fp: _ArrayLikeComplex_co, left: None | _ComplexLike_co = ..., right: None | _ComplexLike_co = ..., period: None | _FloatLike_co = ...) -> NDArray[complex128]:
...
@overload
def angle(z: _ComplexLike_co, deg: bool = ...) -> floating[Any]:
...
@overload
def angle(z: object_, deg: bool = ...) -> Any:
...
@overload
def angle(z: _ArrayLikeComplex_co, deg: bool = ...) -> NDArray[floating[Any]]:
...
@overload
def angle(z: _ArrayLikeObject_co, deg: bool = ...) -> NDArray[object_]:
...
@overload
def unwrap(p: _ArrayLikeFloat_co, discont: None | float = ..., axis: int = ..., *, period: float = ...) -> NDArray[floating[Any]]:
...
@overload
def unwrap(p: _ArrayLikeObject_co, discont: None | float = ..., axis: int = ..., *, period: float = ...) -> NDArray[object_]:
...
def sort_complex(a: ArrayLike) -> NDArray[complexfloating[Any, Any]]:
...
def trim_zeros(filt: _TrimZerosSequence[_T], trim: L["f", "b", "fb", "bf"] = ...) -> _T:
...
@overload
def extract(condition: ArrayLike, arr: _ArrayLike[_SCT]) -> NDArray[_SCT]:
...
@overload
def extract(condition: ArrayLike, arr: ArrayLike) -> NDArray[Any]:
...
def place(arr: NDArray[Any], mask: ArrayLike, vals: Any) -> None:
...
def disp(mesg: object, device: None | _SupportsWriteFlush = ..., linefeed: bool = ...) -> None:
...
@overload
def cov(m: _ArrayLikeFloat_co, y: None | _ArrayLikeFloat_co = ..., rowvar: bool = ..., bias: bool = ..., ddof: None | SupportsIndex | SupportsInt = ..., fweights: None | ArrayLike = ..., aweights: None | ArrayLike = ..., *, dtype: None = ...) -> NDArray[floating[Any]]:
...
@overload
def cov(m: _ArrayLikeComplex_co, y: None | _ArrayLikeComplex_co = ..., rowvar: bool = ..., bias: bool = ..., ddof: None | SupportsIndex | SupportsInt = ..., fweights: None | ArrayLike = ..., aweights: None | ArrayLike = ..., *, dtype: None = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def cov(m: _ArrayLikeComplex_co, y: None | _ArrayLikeComplex_co = ..., rowvar: bool = ..., bias: bool = ..., ddof: None | SupportsIndex | SupportsInt = ..., fweights: None | ArrayLike = ..., aweights: None | ArrayLike = ..., *, dtype: _DTypeLike[_SCT]) -> NDArray[_SCT]:
...
@overload
def cov(m: _ArrayLikeComplex_co, y: None | _ArrayLikeComplex_co = ..., rowvar: bool = ..., bias: bool = ..., ddof: None | SupportsIndex | SupportsInt = ..., fweights: None | ArrayLike = ..., aweights: None | ArrayLike = ..., *, dtype: DTypeLike) -> NDArray[Any]:
...
@overload
def corrcoef(m: _ArrayLikeFloat_co, y: None | _ArrayLikeFloat_co = ..., rowvar: bool = ..., *, dtype: None = ...) -> NDArray[floating[Any]]:
...
@overload
def corrcoef(m: _ArrayLikeComplex_co, y: None | _ArrayLikeComplex_co = ..., rowvar: bool = ..., *, dtype: None = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def corrcoef(m: _ArrayLikeComplex_co, y: None | _ArrayLikeComplex_co = ..., rowvar: bool = ..., *, dtype: _DTypeLike[_SCT]) -> NDArray[_SCT]:
...
@overload
def corrcoef(m: _ArrayLikeComplex_co, y: None | _ArrayLikeComplex_co = ..., rowvar: bool = ..., *, dtype: DTypeLike) -> NDArray[Any]:
...
def blackman(M: _FloatLike_co) -> NDArray[floating[Any]]:
...
def bartlett(M: _FloatLike_co) -> NDArray[floating[Any]]:
...
def hanning(M: _FloatLike_co) -> NDArray[floating[Any]]:
...
def hamming(M: _FloatLike_co) -> NDArray[floating[Any]]:
...
def i0(x: _ArrayLikeFloat_co) -> NDArray[floating[Any]]:
...
def kaiser(M: _FloatLike_co, beta: _FloatLike_co) -> NDArray[floating[Any]]:
...
@overload
def sinc(x: _FloatLike_co) -> floating[Any]:
...
@overload
def sinc(x: _ComplexLike_co) -> complexfloating[Any, Any]:
...
@overload
def sinc(x: _ArrayLikeFloat_co) -> NDArray[floating[Any]]:
...
@overload
def sinc(x: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def median(a: _ArrayLikeFloat_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., keepdims: L[False] = ...) -> floating[Any]:
...
@overload
def median(a: _ArrayLikeComplex_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., keepdims: L[False] = ...) -> complexfloating[Any, Any]:
...
@overload
def median(a: _ArrayLikeTD64_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., keepdims: L[False] = ...) -> timedelta64:
...
@overload
def median(a: _ArrayLikeObject_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., keepdims: L[False] = ...) -> Any:
...
@overload
def median(a: _ArrayLikeFloat_co | _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., out: None = ..., overwrite_input: bool = ..., keepdims: bool = ...) -> Any:
...
@overload
def median(a: _ArrayLikeFloat_co | _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., out: _ArrayType = ..., overwrite_input: bool = ..., keepdims: bool = ...) -> _ArrayType:
...
_MethodKind = L["inverted_cdf", "averaged_inverted_cdf", "closest_observation", "interpolated_inverted_cdf", "hazen", "weibull", "linear", "median_unbiased", "normal_unbiased", "lower", "higher", "midpoint", "nearest",]
@overload
def percentile(a: _ArrayLikeFloat_co, q: _FloatLike_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., method: _MethodKind = ..., keepdims: L[False] = ...) -> floating[Any]:
...
@overload
def percentile(a: _ArrayLikeComplex_co, q: _FloatLike_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., method: _MethodKind = ..., keepdims: L[False] = ...) -> complexfloating[Any, Any]:
...
@overload
def percentile(a: _ArrayLikeTD64_co, q: _FloatLike_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., method: _MethodKind = ..., keepdims: L[False] = ...) -> timedelta64:
...
@overload
def percentile(a: _ArrayLikeDT64_co, q: _FloatLike_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., method: _MethodKind = ..., keepdims: L[False] = ...) -> datetime64:
...
@overload
def percentile(a: _ArrayLikeObject_co, q: _FloatLike_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., method: _MethodKind = ..., keepdims: L[False] = ...) -> Any:
...
@overload
def percentile(a: _ArrayLikeFloat_co, q: _ArrayLikeFloat_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., method: _MethodKind = ..., keepdims: L[False] = ...) -> NDArray[floating[Any]]:
...
@overload
def percentile(a: _ArrayLikeComplex_co, q: _ArrayLikeFloat_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., method: _MethodKind = ..., keepdims: L[False] = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def percentile(a: _ArrayLikeTD64_co, q: _ArrayLikeFloat_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., method: _MethodKind = ..., keepdims: L[False] = ...) -> NDArray[timedelta64]:
...
@overload
def percentile(a: _ArrayLikeDT64_co, q: _ArrayLikeFloat_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., method: _MethodKind = ..., keepdims: L[False] = ...) -> NDArray[datetime64]:
...
@overload
def percentile(a: _ArrayLikeObject_co, q: _ArrayLikeFloat_co, axis: None = ..., out: None = ..., overwrite_input: bool = ..., method: _MethodKind = ..., keepdims: L[False] = ...) -> NDArray[object_]:
...
@overload
def percentile(a: _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeTD64_co | _ArrayLikeObject_co, q: _ArrayLikeFloat_co, axis: None | _ShapeLike = ..., out: None = ..., overwrite_input: bool = ..., method: _MethodKind = ..., keepdims: bool = ...) -> Any:
...
@overload
def percentile(a: _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeTD64_co | _ArrayLikeObject_co, q: _ArrayLikeFloat_co, axis: None | _ShapeLike = ..., out: _ArrayType = ..., overwrite_input: bool = ..., method: _MethodKind = ..., keepdims: bool = ...) -> _ArrayType:
...
quantile = ...
def trapz(y: _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeObject_co, x: None | _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeObject_co = ..., dx: float = ..., axis: SupportsIndex = ...) -> Any:
...
def meshgrid(*xi: ArrayLike, copy: bool = ..., sparse: bool = ..., indexing: L["xy", "ij"] = ...) -> list[NDArray[Any]]:
...
@overload
def delete(arr: _ArrayLike[_SCT], obj: slice | _ArrayLikeInt_co, axis: None | SupportsIndex = ...) -> NDArray[_SCT]:
...
@overload
def delete(arr: ArrayLike, obj: slice | _ArrayLikeInt_co, axis: None | SupportsIndex = ...) -> NDArray[Any]:
...
@overload
def insert(arr: _ArrayLike[_SCT], obj: slice | _ArrayLikeInt_co, values: ArrayLike, axis: None | SupportsIndex = ...) -> NDArray[_SCT]:
...
@overload
def insert(arr: ArrayLike, obj: slice | _ArrayLikeInt_co, values: ArrayLike, axis: None | SupportsIndex = ...) -> NDArray[Any]:
...
def append(arr: ArrayLike, values: ArrayLike, axis: None | SupportsIndex = ...) -> NDArray[Any]:
...
@overload
def digitize(x: _FloatLike_co, bins: _ArrayLikeFloat_co, right: bool = ...) -> intp:
...
@overload
def digitize(x: _ArrayLikeFloat_co, bins: _ArrayLikeFloat_co, right: bool = ...) -> NDArray[intp]:
...

View file

@ -0,0 +1,19 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Sequence
from typing import Any, Literal as L, SupportsIndex
from numpy._typing import ArrayLike, NDArray
_BinKind = L["stone", "auto", "doane", "fd", "rice", "scott", "sqrt", "sturges",]
__all__: list[str]
def histogram_bin_edges(a: ArrayLike, bins: _BinKind | SupportsIndex | ArrayLike = ..., range: None | tuple[float, float] = ..., weights: None | ArrayLike = ...) -> NDArray[Any]:
...
def histogram(a: ArrayLike, bins: _BinKind | SupportsIndex | ArrayLike = ..., range: None | tuple[float, float] = ..., density: bool = ..., weights: None | ArrayLike = ...) -> tuple[NDArray[Any], NDArray[Any]]:
...
def histogramdd(sample: ArrayLike, bins: SupportsIndex | ArrayLike = ..., range: Sequence[tuple[float, float]] = ..., density: None | bool = ..., weights: None | ArrayLike = ...) -> tuple[NDArray[Any], list[NDArray[Any]]]:
...

View file

@ -0,0 +1,151 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Sequence
from typing import Any, Generic, Literal, SupportsIndex, TypeVar, overload
from numpy import bool_, bytes_, complex_, dtype, float_, int_, matrix as _Matrix, ndarray, str_
from numpy._typing import ArrayLike, DTypeLike, NDArray, _FiniteNestedSequence, _NestedSequence, _SupportsDType
_T = TypeVar("_T")
_DType = TypeVar("_DType", bound=dtype[Any])
_BoolType = TypeVar("_BoolType", Literal[True], Literal[False])
_TupType = TypeVar("_TupType", bound=tuple[Any, ...])
_ArrayType = TypeVar("_ArrayType", bound=ndarray[Any, Any])
__all__: list[str]
@overload
def ix_(*args: _FiniteNestedSequence[_SupportsDType[_DType]]) -> tuple[ndarray[Any, _DType], ...]:
...
@overload
def ix_(*args: str | _NestedSequence[str]) -> tuple[NDArray[str_], ...]:
...
@overload
def ix_(*args: bytes | _NestedSequence[bytes]) -> tuple[NDArray[bytes_], ...]:
...
@overload
def ix_(*args: bool | _NestedSequence[bool]) -> tuple[NDArray[bool_], ...]:
...
@overload
def ix_(*args: int | _NestedSequence[int]) -> tuple[NDArray[int_], ...]:
...
@overload
def ix_(*args: float | _NestedSequence[float]) -> tuple[NDArray[float_], ...]:
...
@overload
def ix_(*args: complex | _NestedSequence[complex]) -> tuple[NDArray[complex_], ...]:
...
class nd_grid(Generic[_BoolType]):
sparse: _BoolType
def __init__(self, sparse: _BoolType = ...) -> None:
...
@overload
def __getitem__(self: nd_grid[Literal[False]], key: slice | Sequence[slice]) -> NDArray[Any]:
...
@overload
def __getitem__(self: nd_grid[Literal[True]], key: slice | Sequence[slice]) -> list[NDArray[Any]]:
...
class MGridClass(nd_grid[Literal[False]]):
def __init__(self) -> None:
...
mgrid: MGridClass
class OGridClass(nd_grid[Literal[True]]):
def __init__(self) -> None:
...
ogrid: OGridClass
class AxisConcatenator:
axis: int
matrix: bool
ndmin: int
trans1d: int
def __init__(self, axis: int = ..., matrix: bool = ..., ndmin: int = ..., trans1d: int = ...) -> None:
...
@staticmethod
@overload
def concatenate(*a: ArrayLike, axis: SupportsIndex = ..., out: None = ...) -> NDArray[Any]:
...
@staticmethod
@overload
def concatenate(*a: ArrayLike, axis: SupportsIndex = ..., out: _ArrayType = ...) -> _ArrayType:
...
@staticmethod
def makemat(data: ArrayLike, dtype: DTypeLike = ..., copy: bool = ...) -> _Matrix[Any, Any]:
...
def __getitem__(self, key: Any) -> Any:
...
class RClass(AxisConcatenator):
axis: Literal[0]
matrix: Literal[False]
ndmin: Literal[1]
trans1d: Literal[-1]
def __init__(self) -> None:
...
r_: RClass
class CClass(AxisConcatenator):
axis: Literal[-1]
matrix: Literal[False]
ndmin: Literal[2]
trans1d: Literal[0]
def __init__(self) -> None:
...
c_: CClass
class IndexExpression(Generic[_BoolType]):
maketuple: _BoolType
def __init__(self, maketuple: _BoolType) -> None:
...
@overload
def __getitem__(self, item: _TupType) -> _TupType:
...
@overload
def __getitem__(self: IndexExpression[Literal[True]], item: _T) -> tuple[_T]:
...
@overload
def __getitem__(self: IndexExpression[Literal[False]], item: _T) -> _T:
...
index_exp: IndexExpression[Literal[True]]
s_: IndexExpression[Literal[False]]
def fill_diagonal(a: ndarray[Any, Any], val: Any, wrap: bool = ...) -> None:
...
def diag_indices(n: int, ndim: int = ...) -> tuple[NDArray[int_], ...]:
...
def diag_indices_from(arr: ArrayLike) -> tuple[NDArray[int_], ...]:
...

View file

@ -0,0 +1,169 @@
"""
This type stub file was generated by pyright.
"""
from abc import ABCMeta, abstractmethod
from typing import Any, Literal as L
from numpy import ufunc
__all__: list[str]
class NDArrayOperatorsMixin(metaclass=ABCMeta):
@abstractmethod
def __array_ufunc__(self, ufunc: ufunc, method: L["__call__", "reduce", "reduceat", "accumulate", "outer", "inner"], *inputs: Any, **kwargs: Any) -> Any:
...
def __lt__(self, other: Any) -> Any:
...
def __le__(self, other: Any) -> Any:
...
def __eq__(self, other: Any) -> Any:
...
def __ne__(self, other: Any) -> Any:
...
def __gt__(self, other: Any) -> Any:
...
def __ge__(self, other: Any) -> Any:
...
def __add__(self, other: Any) -> Any:
...
def __radd__(self, other: Any) -> Any:
...
def __iadd__(self, other: Any) -> Any:
...
def __sub__(self, other: Any) -> Any:
...
def __rsub__(self, other: Any) -> Any:
...
def __isub__(self, other: Any) -> Any:
...
def __mul__(self, other: Any) -> Any:
...
def __rmul__(self, other: Any) -> Any:
...
def __imul__(self, other: Any) -> Any:
...
def __matmul__(self, other: Any) -> Any:
...
def __rmatmul__(self, other: Any) -> Any:
...
def __imatmul__(self, other: Any) -> Any:
...
def __truediv__(self, other: Any) -> Any:
...
def __rtruediv__(self, other: Any) -> Any:
...
def __itruediv__(self, other: Any) -> Any:
...
def __floordiv__(self, other: Any) -> Any:
...
def __rfloordiv__(self, other: Any) -> Any:
...
def __ifloordiv__(self, other: Any) -> Any:
...
def __mod__(self, other: Any) -> Any:
...
def __rmod__(self, other: Any) -> Any:
...
def __imod__(self, other: Any) -> Any:
...
def __divmod__(self, other: Any) -> Any:
...
def __rdivmod__(self, other: Any) -> Any:
...
def __pow__(self, other: Any) -> Any:
...
def __rpow__(self, other: Any) -> Any:
...
def __ipow__(self, other: Any) -> Any:
...
def __lshift__(self, other: Any) -> Any:
...
def __rlshift__(self, other: Any) -> Any:
...
def __ilshift__(self, other: Any) -> Any:
...
def __rshift__(self, other: Any) -> Any:
...
def __rrshift__(self, other: Any) -> Any:
...
def __irshift__(self, other: Any) -> Any:
...
def __and__(self, other: Any) -> Any:
...
def __rand__(self, other: Any) -> Any:
...
def __iand__(self, other: Any) -> Any:
...
def __xor__(self, other: Any) -> Any:
...
def __rxor__(self, other: Any) -> Any:
...
def __ixor__(self, other: Any) -> Any:
...
def __or__(self, other: Any) -> Any:
...
def __ror__(self, other: Any) -> Any:
...
def __ior__(self, other: Any) -> Any:
...
def __neg__(self) -> Any:
...
def __pos__(self) -> Any:
...
def __abs__(self) -> Any:
...
def __invert__(self) -> Any:
...

View file

@ -0,0 +1,19 @@
"""
This type stub file was generated by pyright.
"""
__all__: list[str]
nanmin = ...
nanmax = ...
nanargmin = ...
nanargmax = ...
nansum = ...
nanprod = ...
nancumsum = ...
nancumprod = ...
nanmean = ...
nanvar = ...
nanstd = ...
nanmedian = ...
nanpercentile = ...
nanquantile = ...

170
typings/numpy/lib/npyio.pyi Normal file
View file

@ -0,0 +1,170 @@
"""
This type stub file was generated by pyright.
"""
import os
import zipfile
import types
from re import Pattern
from collections.abc import Callable, Collection, Iterable, Iterator, Mapping, Sequence
from typing import Any, Generic, IO, Literal as L, Protocol, TypeVar, overload
from numpy import dtype, float64, generic, recarray, record, void
from numpy.ma.mrecords import MaskedRecords
from numpy._typing import ArrayLike, DTypeLike, NDArray, _DTypeLike, _SupportsArrayFunc
_T = TypeVar("_T")
_T_contra = TypeVar("_T_contra", contravariant=True)
_T_co = TypeVar("_T_co", covariant=True)
_SCT = TypeVar("_SCT", bound=generic)
_CharType_co = TypeVar("_CharType_co", str, bytes, covariant=True)
_CharType_contra = TypeVar("_CharType_contra", str, bytes, contravariant=True)
class _SupportsGetItem(Protocol[_T_contra, _T_co]):
def __getitem__(self, key: _T_contra, /) -> _T_co:
...
class _SupportsRead(Protocol[_CharType_co]):
def read(self) -> _CharType_co:
...
class _SupportsReadSeek(Protocol[_CharType_co]):
def read(self, n: int, /) -> _CharType_co:
...
def seek(self, offset: int, whence: int, /) -> object:
...
class _SupportsWrite(Protocol[_CharType_contra]):
def write(self, s: _CharType_contra, /) -> object:
...
__all__: list[str]
class BagObj(Generic[_T_co]):
def __init__(self, obj: _SupportsGetItem[str, _T_co]) -> None:
...
def __getattribute__(self, key: str) -> _T_co:
...
def __dir__(self) -> list[str]:
...
class NpzFile(Mapping[str, NDArray[Any]]):
zip: zipfile.ZipFile
fid: None | IO[str]
files: list[str]
allow_pickle: bool
pickle_kwargs: None | Mapping[str, Any]
_MAX_REPR_ARRAY_COUNT: int
@property
def f(self: _T) -> BagObj[_T]:
...
@f.setter
def f(self: _T, value: BagObj[_T]) -> None:
...
def __init__(self, fid: IO[str], own_fid: bool = ..., allow_pickle: bool = ..., pickle_kwargs: None | Mapping[str, Any] = ...) -> None:
...
def __enter__(self: _T) -> _T:
...
def __exit__(self, exc_type: None | type[BaseException], exc_value: None | BaseException, traceback: None | types.TracebackType, /) -> None:
...
def close(self) -> None:
...
def __del__(self) -> None:
...
def __iter__(self) -> Iterator[str]:
...
def __len__(self) -> int:
...
def __getitem__(self, key: str) -> NDArray[Any]:
...
def __contains__(self, key: str) -> bool:
...
def __repr__(self) -> str:
...
def load(file: str | bytes | os.PathLike[Any] | _SupportsReadSeek[bytes], mmap_mode: L[None, "r+", "r", "w+", "c"] = ..., allow_pickle: bool = ..., fix_imports: bool = ..., encoding: L["ASCII", "latin1", "bytes"] = ...) -> Any:
...
def save(file: str | os.PathLike[str] | _SupportsWrite[bytes], arr: ArrayLike, allow_pickle: bool = ..., fix_imports: bool = ...) -> None:
...
def savez(file: str | os.PathLike[str] | _SupportsWrite[bytes], *args: ArrayLike, **kwds: ArrayLike) -> None:
...
def savez_compressed(file: str | os.PathLike[str] | _SupportsWrite[bytes], *args: ArrayLike, **kwds: ArrayLike) -> None:
...
@overload
def loadtxt(fname: str | os.PathLike[str] | Iterable[str] | Iterable[bytes], dtype: None = ..., comments: None | str | Sequence[str] = ..., delimiter: None | str = ..., converters: None | Mapping[int | str, Callable[[str], Any]] = ..., skiprows: int = ..., usecols: int | Sequence[int] = ..., unpack: bool = ..., ndmin: L[0, 1, 2] = ..., encoding: None | str = ..., max_rows: None | int = ..., *, quotechar: None | str = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[float64]:
...
@overload
def loadtxt(fname: str | os.PathLike[str] | Iterable[str] | Iterable[bytes], dtype: _DTypeLike[_SCT], comments: None | str | Sequence[str] = ..., delimiter: None | str = ..., converters: None | Mapping[int | str, Callable[[str], Any]] = ..., skiprows: int = ..., usecols: int | Sequence[int] = ..., unpack: bool = ..., ndmin: L[0, 1, 2] = ..., encoding: None | str = ..., max_rows: None | int = ..., *, quotechar: None | str = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def loadtxt(fname: str | os.PathLike[str] | Iterable[str] | Iterable[bytes], dtype: DTypeLike, comments: None | str | Sequence[str] = ..., delimiter: None | str = ..., converters: None | Mapping[int | str, Callable[[str], Any]] = ..., skiprows: int = ..., usecols: int | Sequence[int] = ..., unpack: bool = ..., ndmin: L[0, 1, 2] = ..., encoding: None | str = ..., max_rows: None | int = ..., *, quotechar: None | str = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
def savetxt(fname: str | os.PathLike[str] | _SupportsWrite[str] | _SupportsWrite[bytes], X: ArrayLike, fmt: str | Sequence[str] = ..., delimiter: str = ..., newline: str = ..., header: str = ..., footer: str = ..., comments: str = ..., encoding: None | str = ...) -> None:
...
@overload
def fromregex(file: str | os.PathLike[str] | _SupportsRead[str] | _SupportsRead[bytes], regexp: str | bytes | Pattern[Any], dtype: _DTypeLike[_SCT], encoding: None | str = ...) -> NDArray[_SCT]:
...
@overload
def fromregex(file: str | os.PathLike[str] | _SupportsRead[str] | _SupportsRead[bytes], regexp: str | bytes | Pattern[Any], dtype: DTypeLike, encoding: None | str = ...) -> NDArray[Any]:
...
@overload
def genfromtxt(fname: str | os.PathLike[str] | Iterable[str] | Iterable[bytes], dtype: None = ..., comments: str = ..., delimiter: None | str | int | Iterable[int] = ..., skip_header: int = ..., skip_footer: int = ..., converters: None | Mapping[int | str, Callable[[str], Any]] = ..., missing_values: Any = ..., filling_values: Any = ..., usecols: None | Sequence[int] = ..., names: L[None, True] | str | Collection[str] = ..., excludelist: None | Sequence[str] = ..., deletechars: str = ..., replace_space: str = ..., autostrip: bool = ..., case_sensitive: bool | L['upper', 'lower'] = ..., defaultfmt: str = ..., unpack: None | bool = ..., usemask: bool = ..., loose: bool = ..., invalid_raise: bool = ..., max_rows: None | int = ..., encoding: str = ..., *, ndmin: L[0, 1, 2] = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def genfromtxt(fname: str | os.PathLike[str] | Iterable[str] | Iterable[bytes], dtype: _DTypeLike[_SCT], comments: str = ..., delimiter: None | str | int | Iterable[int] = ..., skip_header: int = ..., skip_footer: int = ..., converters: None | Mapping[int | str, Callable[[str], Any]] = ..., missing_values: Any = ..., filling_values: Any = ..., usecols: None | Sequence[int] = ..., names: L[None, True] | str | Collection[str] = ..., excludelist: None | Sequence[str] = ..., deletechars: str = ..., replace_space: str = ..., autostrip: bool = ..., case_sensitive: bool | L['upper', 'lower'] = ..., defaultfmt: str = ..., unpack: None | bool = ..., usemask: bool = ..., loose: bool = ..., invalid_raise: bool = ..., max_rows: None | int = ..., encoding: str = ..., *, ndmin: L[0, 1, 2] = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def genfromtxt(fname: str | os.PathLike[str] | Iterable[str] | Iterable[bytes], dtype: DTypeLike, comments: str = ..., delimiter: None | str | int | Iterable[int] = ..., skip_header: int = ..., skip_footer: int = ..., converters: None | Mapping[int | str, Callable[[str], Any]] = ..., missing_values: Any = ..., filling_values: Any = ..., usecols: None | Sequence[int] = ..., names: L[None, True] | str | Collection[str] = ..., excludelist: None | Sequence[str] = ..., deletechars: str = ..., replace_space: str = ..., autostrip: bool = ..., case_sensitive: bool | L['upper', 'lower'] = ..., defaultfmt: str = ..., unpack: None | bool = ..., usemask: bool = ..., loose: bool = ..., invalid_raise: bool = ..., max_rows: None | int = ..., encoding: str = ..., *, ndmin: L[0, 1, 2] = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def recfromtxt(fname: str | os.PathLike[str] | Iterable[str] | Iterable[bytes], *, usemask: L[False] = ..., **kwargs: Any) -> recarray[Any, dtype[record]]:
...
@overload
def recfromtxt(fname: str | os.PathLike[str] | Iterable[str] | Iterable[bytes], *, usemask: L[True], **kwargs: Any) -> MaskedRecords[Any, dtype[void]]:
...
@overload
def recfromcsv(fname: str | os.PathLike[str] | Iterable[str] | Iterable[bytes], *, usemask: L[False] = ..., **kwargs: Any) -> recarray[Any, dtype[record]]:
...
@overload
def recfromcsv(fname: str | os.PathLike[str] | Iterable[str] | Iterable[bytes], *, usemask: L[True], **kwargs: Any) -> MaskedRecords[Any, dtype[void]]:
...

View file

@ -0,0 +1,183 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, Literal as L, NoReturn, SupportsIndex, SupportsInt, TypeVar, overload
from numpy import bool_, complex128, complexfloating, float64, floating, int32, int64, object_, poly1d as poly1d, signedinteger, unsignedinteger
from numpy._typing import ArrayLike, NDArray, _ArrayLikeBool_co, _ArrayLikeComplex_co, _ArrayLikeFloat_co, _ArrayLikeInt_co, _ArrayLikeObject_co, _ArrayLikeUInt_co
_T = TypeVar("_T")
_2Tup = tuple[_T, _T]
_5Tup = tuple[_T, NDArray[float64], NDArray[int32], NDArray[float64], NDArray[float64],]
__all__: list[str]
def poly(seq_of_zeros: ArrayLike) -> NDArray[floating[Any]]:
...
def roots(p: ArrayLike) -> NDArray[complexfloating[Any, Any]] | NDArray[floating[Any]]:
...
@overload
def polyint(p: poly1d, m: SupportsInt | SupportsIndex = ..., k: None | _ArrayLikeComplex_co | _ArrayLikeObject_co = ...) -> poly1d:
...
@overload
def polyint(p: _ArrayLikeFloat_co, m: SupportsInt | SupportsIndex = ..., k: None | _ArrayLikeFloat_co = ...) -> NDArray[floating[Any]]:
...
@overload
def polyint(p: _ArrayLikeComplex_co, m: SupportsInt | SupportsIndex = ..., k: None | _ArrayLikeComplex_co = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def polyint(p: _ArrayLikeObject_co, m: SupportsInt | SupportsIndex = ..., k: None | _ArrayLikeObject_co = ...) -> NDArray[object_]:
...
@overload
def polyder(p: poly1d, m: SupportsInt | SupportsIndex = ...) -> poly1d:
...
@overload
def polyder(p: _ArrayLikeFloat_co, m: SupportsInt | SupportsIndex = ...) -> NDArray[floating[Any]]:
...
@overload
def polyder(p: _ArrayLikeComplex_co, m: SupportsInt | SupportsIndex = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def polyder(p: _ArrayLikeObject_co, m: SupportsInt | SupportsIndex = ...) -> NDArray[object_]:
...
@overload
def polyfit(x: _ArrayLikeFloat_co, y: _ArrayLikeFloat_co, deg: SupportsIndex | SupportsInt, rcond: None | float = ..., full: L[False] = ..., w: None | _ArrayLikeFloat_co = ..., cov: L[False] = ...) -> NDArray[float64]:
...
@overload
def polyfit(x: _ArrayLikeComplex_co, y: _ArrayLikeComplex_co, deg: SupportsIndex | SupportsInt, rcond: None | float = ..., full: L[False] = ..., w: None | _ArrayLikeFloat_co = ..., cov: L[False] = ...) -> NDArray[complex128]:
...
@overload
def polyfit(x: _ArrayLikeFloat_co, y: _ArrayLikeFloat_co, deg: SupportsIndex | SupportsInt, rcond: None | float = ..., full: L[False] = ..., w: None | _ArrayLikeFloat_co = ..., cov: L[True, "unscaled"] = ...) -> _2Tup[NDArray[float64]]:
...
@overload
def polyfit(x: _ArrayLikeComplex_co, y: _ArrayLikeComplex_co, deg: SupportsIndex | SupportsInt, rcond: None | float = ..., full: L[False] = ..., w: None | _ArrayLikeFloat_co = ..., cov: L[True, "unscaled"] = ...) -> _2Tup[NDArray[complex128]]:
...
@overload
def polyfit(x: _ArrayLikeFloat_co, y: _ArrayLikeFloat_co, deg: SupportsIndex | SupportsInt, rcond: None | float = ..., full: L[True] = ..., w: None | _ArrayLikeFloat_co = ..., cov: bool | L["unscaled"] = ...) -> _5Tup[NDArray[float64]]:
...
@overload
def polyfit(x: _ArrayLikeComplex_co, y: _ArrayLikeComplex_co, deg: SupportsIndex | SupportsInt, rcond: None | float = ..., full: L[True] = ..., w: None | _ArrayLikeFloat_co = ..., cov: bool | L["unscaled"] = ...) -> _5Tup[NDArray[complex128]]:
...
@overload
def polyval(p: _ArrayLikeBool_co, x: _ArrayLikeBool_co) -> NDArray[int64]:
...
@overload
def polyval(p: _ArrayLikeUInt_co, x: _ArrayLikeUInt_co) -> NDArray[unsignedinteger[Any]]:
...
@overload
def polyval(p: _ArrayLikeInt_co, x: _ArrayLikeInt_co) -> NDArray[signedinteger[Any]]:
...
@overload
def polyval(p: _ArrayLikeFloat_co, x: _ArrayLikeFloat_co) -> NDArray[floating[Any]]:
...
@overload
def polyval(p: _ArrayLikeComplex_co, x: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def polyval(p: _ArrayLikeObject_co, x: _ArrayLikeObject_co) -> NDArray[object_]:
...
@overload
def polyadd(a1: poly1d, a2: _ArrayLikeComplex_co | _ArrayLikeObject_co) -> poly1d:
...
@overload
def polyadd(a1: _ArrayLikeComplex_co | _ArrayLikeObject_co, a2: poly1d) -> poly1d:
...
@overload
def polyadd(a1: _ArrayLikeBool_co, a2: _ArrayLikeBool_co) -> NDArray[bool_]:
...
@overload
def polyadd(a1: _ArrayLikeUInt_co, a2: _ArrayLikeUInt_co) -> NDArray[unsignedinteger[Any]]:
...
@overload
def polyadd(a1: _ArrayLikeInt_co, a2: _ArrayLikeInt_co) -> NDArray[signedinteger[Any]]:
...
@overload
def polyadd(a1: _ArrayLikeFloat_co, a2: _ArrayLikeFloat_co) -> NDArray[floating[Any]]:
...
@overload
def polyadd(a1: _ArrayLikeComplex_co, a2: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def polyadd(a1: _ArrayLikeObject_co, a2: _ArrayLikeObject_co) -> NDArray[object_]:
...
@overload
def polysub(a1: poly1d, a2: _ArrayLikeComplex_co | _ArrayLikeObject_co) -> poly1d:
...
@overload
def polysub(a1: _ArrayLikeComplex_co | _ArrayLikeObject_co, a2: poly1d) -> poly1d:
...
@overload
def polysub(a1: _ArrayLikeBool_co, a2: _ArrayLikeBool_co) -> NoReturn:
...
@overload
def polysub(a1: _ArrayLikeUInt_co, a2: _ArrayLikeUInt_co) -> NDArray[unsignedinteger[Any]]:
...
@overload
def polysub(a1: _ArrayLikeInt_co, a2: _ArrayLikeInt_co) -> NDArray[signedinteger[Any]]:
...
@overload
def polysub(a1: _ArrayLikeFloat_co, a2: _ArrayLikeFloat_co) -> NDArray[floating[Any]]:
...
@overload
def polysub(a1: _ArrayLikeComplex_co, a2: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def polysub(a1: _ArrayLikeObject_co, a2: _ArrayLikeObject_co) -> NDArray[object_]:
...
polymul = ...
@overload
def polydiv(u: poly1d, v: _ArrayLikeComplex_co | _ArrayLikeObject_co) -> _2Tup[poly1d]:
...
@overload
def polydiv(u: _ArrayLikeComplex_co | _ArrayLikeObject_co, v: poly1d) -> _2Tup[poly1d]:
...
@overload
def polydiv(u: _ArrayLikeFloat_co, v: _ArrayLikeFloat_co) -> _2Tup[NDArray[floating[Any]]]:
...
@overload
def polydiv(u: _ArrayLikeComplex_co, v: _ArrayLikeComplex_co) -> _2Tup[NDArray[complexfloating[Any, Any]]]:
...
@overload
def polydiv(u: _ArrayLikeObject_co, v: _ArrayLikeObject_co) -> _2Tup[NDArray[Any]]:
...

View file

@ -0,0 +1,153 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, overload
from numpy import complexfloating
from numpy._typing import NDArray, _ArrayLikeComplex_co, _ArrayLikeFloat_co, _ComplexLike_co, _FloatLike_co
__all__: list[str]
@overload
def sqrt(x: _FloatLike_co) -> Any:
...
@overload
def sqrt(x: _ComplexLike_co) -> complexfloating[Any, Any]:
...
@overload
def sqrt(x: _ArrayLikeFloat_co) -> NDArray[Any]:
...
@overload
def sqrt(x: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def log(x: _FloatLike_co) -> Any:
...
@overload
def log(x: _ComplexLike_co) -> complexfloating[Any, Any]:
...
@overload
def log(x: _ArrayLikeFloat_co) -> NDArray[Any]:
...
@overload
def log(x: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def log10(x: _FloatLike_co) -> Any:
...
@overload
def log10(x: _ComplexLike_co) -> complexfloating[Any, Any]:
...
@overload
def log10(x: _ArrayLikeFloat_co) -> NDArray[Any]:
...
@overload
def log10(x: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def log2(x: _FloatLike_co) -> Any:
...
@overload
def log2(x: _ComplexLike_co) -> complexfloating[Any, Any]:
...
@overload
def log2(x: _ArrayLikeFloat_co) -> NDArray[Any]:
...
@overload
def log2(x: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def logn(n: _FloatLike_co, x: _FloatLike_co) -> Any:
...
@overload
def logn(n: _ComplexLike_co, x: _ComplexLike_co) -> complexfloating[Any, Any]:
...
@overload
def logn(n: _ArrayLikeFloat_co, x: _ArrayLikeFloat_co) -> NDArray[Any]:
...
@overload
def logn(n: _ArrayLikeComplex_co, x: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def power(x: _FloatLike_co, p: _FloatLike_co) -> Any:
...
@overload
def power(x: _ComplexLike_co, p: _ComplexLike_co) -> complexfloating[Any, Any]:
...
@overload
def power(x: _ArrayLikeFloat_co, p: _ArrayLikeFloat_co) -> NDArray[Any]:
...
@overload
def power(x: _ArrayLikeComplex_co, p: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def arccos(x: _FloatLike_co) -> Any:
...
@overload
def arccos(x: _ComplexLike_co) -> complexfloating[Any, Any]:
...
@overload
def arccos(x: _ArrayLikeFloat_co) -> NDArray[Any]:
...
@overload
def arccos(x: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def arcsin(x: _FloatLike_co) -> Any:
...
@overload
def arcsin(x: _ComplexLike_co) -> complexfloating[Any, Any]:
...
@overload
def arcsin(x: _ArrayLikeFloat_co) -> NDArray[Any]:
...
@overload
def arcsin(x: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def arctanh(x: _FloatLike_co) -> Any:
...
@overload
def arctanh(x: _ComplexLike_co) -> complexfloating[Any, Any]:
...
@overload
def arctanh(x: _ArrayLikeFloat_co) -> NDArray[Any]:
...
@overload
def arctanh(x: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...

View file

@ -0,0 +1,177 @@
"""
This type stub file was generated by pyright.
"""
import sys
from collections.abc import Callable, Sequence
from typing import Any, Concatenate, ParamSpec, Protocol, SupportsIndex, TypeVar, overload
from numpy import bool_, complexfloating, floating, generic, integer, object_, signedinteger, ufunc, unsignedinteger
from numpy._typing import ArrayLike, NDArray, _ArrayLike, _ArrayLikeBool_co, _ArrayLikeComplex_co, _ArrayLikeFloat_co, _ArrayLikeInt_co, _ArrayLikeObject_co, _ArrayLikeUInt_co, _ShapeLike
if sys.version_info >= (3, 10):
...
else:
...
_P = ParamSpec("_P")
_SCT = TypeVar("_SCT", bound=generic)
class _ArrayWrap(Protocol):
def __call__(self, array: NDArray[Any], context: None | tuple[ufunc, tuple[Any, ...], int] = ..., /) -> Any:
...
class _ArrayPrepare(Protocol):
def __call__(self, array: NDArray[Any], context: None | tuple[ufunc, tuple[Any, ...], int] = ..., /) -> Any:
...
class _SupportsArrayWrap(Protocol):
@property
def __array_wrap__(self) -> _ArrayWrap:
...
class _SupportsArrayPrepare(Protocol):
@property
def __array_prepare__(self) -> _ArrayPrepare:
...
__all__: list[str]
row_stack = ...
def take_along_axis(arr: _SCT | NDArray[_SCT], indices: NDArray[integer[Any]], axis: None | int) -> NDArray[_SCT]:
...
def put_along_axis(arr: NDArray[_SCT], indices: NDArray[integer[Any]], values: ArrayLike, axis: None | int) -> None:
...
@overload
def apply_along_axis(func1d: Callable[Concatenate[NDArray[Any], _P], _ArrayLike[_SCT]], axis: SupportsIndex, arr: ArrayLike, *args: _P.args, **kwargs: _P.kwargs) -> NDArray[_SCT]:
...
@overload
def apply_along_axis(func1d: Callable[Concatenate[NDArray[Any], _P], ArrayLike], axis: SupportsIndex, arr: ArrayLike, *args: _P.args, **kwargs: _P.kwargs) -> NDArray[Any]:
...
def apply_over_axes(func: Callable[[NDArray[Any], int], NDArray[_SCT]], a: ArrayLike, axes: int | Sequence[int]) -> NDArray[_SCT]:
...
@overload
def expand_dims(a: _ArrayLike[_SCT], axis: _ShapeLike) -> NDArray[_SCT]:
...
@overload
def expand_dims(a: ArrayLike, axis: _ShapeLike) -> NDArray[Any]:
...
@overload
def column_stack(tup: Sequence[_ArrayLike[_SCT]]) -> NDArray[_SCT]:
...
@overload
def column_stack(tup: Sequence[ArrayLike]) -> NDArray[Any]:
...
@overload
def dstack(tup: Sequence[_ArrayLike[_SCT]]) -> NDArray[_SCT]:
...
@overload
def dstack(tup: Sequence[ArrayLike]) -> NDArray[Any]:
...
@overload
def array_split(ary: _ArrayLike[_SCT], indices_or_sections: _ShapeLike, axis: SupportsIndex = ...) -> list[NDArray[_SCT]]:
...
@overload
def array_split(ary: ArrayLike, indices_or_sections: _ShapeLike, axis: SupportsIndex = ...) -> list[NDArray[Any]]:
...
@overload
def split(ary: _ArrayLike[_SCT], indices_or_sections: _ShapeLike, axis: SupportsIndex = ...) -> list[NDArray[_SCT]]:
...
@overload
def split(ary: ArrayLike, indices_or_sections: _ShapeLike, axis: SupportsIndex = ...) -> list[NDArray[Any]]:
...
@overload
def hsplit(ary: _ArrayLike[_SCT], indices_or_sections: _ShapeLike) -> list[NDArray[_SCT]]:
...
@overload
def hsplit(ary: ArrayLike, indices_or_sections: _ShapeLike) -> list[NDArray[Any]]:
...
@overload
def vsplit(ary: _ArrayLike[_SCT], indices_or_sections: _ShapeLike) -> list[NDArray[_SCT]]:
...
@overload
def vsplit(ary: ArrayLike, indices_or_sections: _ShapeLike) -> list[NDArray[Any]]:
...
@overload
def dsplit(ary: _ArrayLike[_SCT], indices_or_sections: _ShapeLike) -> list[NDArray[_SCT]]:
...
@overload
def dsplit(ary: ArrayLike, indices_or_sections: _ShapeLike) -> list[NDArray[Any]]:
...
@overload
def get_array_prepare(*args: _SupportsArrayPrepare) -> _ArrayPrepare:
...
@overload
def get_array_prepare(*args: object) -> None | _ArrayPrepare:
...
@overload
def get_array_wrap(*args: _SupportsArrayWrap) -> _ArrayWrap:
...
@overload
def get_array_wrap(*args: object) -> None | _ArrayWrap:
...
@overload
def kron(a: _ArrayLikeBool_co, b: _ArrayLikeBool_co) -> NDArray[bool_]:
...
@overload
def kron(a: _ArrayLikeUInt_co, b: _ArrayLikeUInt_co) -> NDArray[unsignedinteger[Any]]:
...
@overload
def kron(a: _ArrayLikeInt_co, b: _ArrayLikeInt_co) -> NDArray[signedinteger[Any]]:
...
@overload
def kron(a: _ArrayLikeFloat_co, b: _ArrayLikeFloat_co) -> NDArray[floating[Any]]:
...
@overload
def kron(a: _ArrayLikeComplex_co, b: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def kron(a: _ArrayLikeObject_co, b: Any) -> NDArray[object_]:
...
@overload
def kron(a: Any, b: _ArrayLikeObject_co) -> NDArray[object_]:
...
@overload
def tile(A: _ArrayLike[_SCT], reps: int | Sequence[int]) -> NDArray[_SCT]:
...
@overload
def tile(A: ArrayLike, reps: int | Sequence[int]) -> NDArray[Any]:
...

View file

@ -0,0 +1,49 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Iterable
from typing import Any, SupportsIndex, TypeVar, overload
from numpy import generic
from numpy._typing import ArrayLike, NDArray, _ArrayLike, _Shape, _ShapeLike
_SCT = TypeVar("_SCT", bound=generic)
__all__: list[str]
class DummyArray:
__array_interface__: dict[str, Any]
base: None | NDArray[Any]
def __init__(self, interface: dict[str, Any], base: None | NDArray[Any] = ...) -> None:
...
@overload
def as_strided(x: _ArrayLike[_SCT], shape: None | Iterable[int] = ..., strides: None | Iterable[int] = ..., subok: bool = ..., writeable: bool = ...) -> NDArray[_SCT]:
...
@overload
def as_strided(x: ArrayLike, shape: None | Iterable[int] = ..., strides: None | Iterable[int] = ..., subok: bool = ..., writeable: bool = ...) -> NDArray[Any]:
...
@overload
def sliding_window_view(x: _ArrayLike[_SCT], window_shape: int | Iterable[int], axis: None | SupportsIndex = ..., *, subok: bool = ..., writeable: bool = ...) -> NDArray[_SCT]:
...
@overload
def sliding_window_view(x: ArrayLike, window_shape: int | Iterable[int], axis: None | SupportsIndex = ..., *, subok: bool = ..., writeable: bool = ...) -> NDArray[Any]:
...
@overload
def broadcast_to(array: _ArrayLike[_SCT], shape: int | Iterable[int], subok: bool = ...) -> NDArray[_SCT]:
...
@overload
def broadcast_to(array: ArrayLike, shape: int | Iterable[int], subok: bool = ...) -> NDArray[Any]:
...
def broadcast_shapes(*args: _ShapeLike) -> _Shape:
...
def broadcast_arrays(*args: ArrayLike, subok: bool = ...) -> list[NDArray[Any]]:
...

View file

@ -0,0 +1,133 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Callable, Sequence
from typing import Any, TypeVar, Union, overload
from numpy import _OrderCF, bool_, complexfloating, datetime64, float64, floating, generic, int_, intp, number, object_, signedinteger, timedelta64
from numpy._typing import ArrayLike, DTypeLike, NDArray, _ArrayLike, _ArrayLikeComplex_co, _ArrayLikeFloat_co, _ArrayLikeInt_co, _ArrayLikeObject_co, _DTypeLike, _SupportsArrayFunc
_T = TypeVar("_T")
_SCT = TypeVar("_SCT", bound=generic)
_MaskFunc = Callable[[NDArray[int_], _T], NDArray[Union[number[Any], bool_, timedelta64, datetime64, object_]],]
__all__: list[str]
@overload
def fliplr(m: _ArrayLike[_SCT]) -> NDArray[_SCT]:
...
@overload
def fliplr(m: ArrayLike) -> NDArray[Any]:
...
@overload
def flipud(m: _ArrayLike[_SCT]) -> NDArray[_SCT]:
...
@overload
def flipud(m: ArrayLike) -> NDArray[Any]:
...
@overload
def eye(N: int, M: None | int = ..., k: int = ..., dtype: None = ..., order: _OrderCF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[float64]:
...
@overload
def eye(N: int, M: None | int = ..., k: int = ..., dtype: _DTypeLike[_SCT] = ..., order: _OrderCF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def eye(N: int, M: None | int = ..., k: int = ..., dtype: DTypeLike = ..., order: _OrderCF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def diag(v: _ArrayLike[_SCT], k: int = ...) -> NDArray[_SCT]:
...
@overload
def diag(v: ArrayLike, k: int = ...) -> NDArray[Any]:
...
@overload
def diagflat(v: _ArrayLike[_SCT], k: int = ...) -> NDArray[_SCT]:
...
@overload
def diagflat(v: ArrayLike, k: int = ...) -> NDArray[Any]:
...
@overload
def tri(N: int, M: None | int = ..., k: int = ..., dtype: None = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[float64]:
...
@overload
def tri(N: int, M: None | int = ..., k: int = ..., dtype: _DTypeLike[_SCT] = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def tri(N: int, M: None | int = ..., k: int = ..., dtype: DTypeLike = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def tril(v: _ArrayLike[_SCT], k: int = ...) -> NDArray[_SCT]:
...
@overload
def tril(v: ArrayLike, k: int = ...) -> NDArray[Any]:
...
@overload
def triu(v: _ArrayLike[_SCT], k: int = ...) -> NDArray[_SCT]:
...
@overload
def triu(v: ArrayLike, k: int = ...) -> NDArray[Any]:
...
@overload
def vander(x: _ArrayLikeInt_co, N: None | int = ..., increasing: bool = ...) -> NDArray[signedinteger[Any]]:
...
@overload
def vander(x: _ArrayLikeFloat_co, N: None | int = ..., increasing: bool = ...) -> NDArray[floating[Any]]:
...
@overload
def vander(x: _ArrayLikeComplex_co, N: None | int = ..., increasing: bool = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def vander(x: _ArrayLikeObject_co, N: None | int = ..., increasing: bool = ...) -> NDArray[object_]:
...
@overload
def histogram2d(x: _ArrayLikeFloat_co, y: _ArrayLikeFloat_co, bins: int | Sequence[int] = ..., range: None | _ArrayLikeFloat_co = ..., density: None | bool = ..., weights: None | _ArrayLikeFloat_co = ...) -> tuple[NDArray[float64], NDArray[floating[Any]], NDArray[floating[Any]],]:
...
@overload
def histogram2d(x: _ArrayLikeComplex_co, y: _ArrayLikeComplex_co, bins: int | Sequence[int] = ..., range: None | _ArrayLikeFloat_co = ..., density: None | bool = ..., weights: None | _ArrayLikeFloat_co = ...) -> tuple[NDArray[float64], NDArray[complexfloating[Any, Any]], NDArray[complexfloating[Any, Any]],]:
...
@overload
def histogram2d(x: _ArrayLikeComplex_co, y: _ArrayLikeComplex_co, bins: Sequence[_ArrayLikeInt_co], range: None | _ArrayLikeFloat_co = ..., density: None | bool = ..., weights: None | _ArrayLikeFloat_co = ...) -> tuple[NDArray[float64], NDArray[Any], NDArray[Any],]:
...
@overload
def mask_indices(n: int, mask_func: _MaskFunc[int], k: int = ...) -> tuple[NDArray[intp], NDArray[intp]]:
...
@overload
def mask_indices(n: int, mask_func: _MaskFunc[_T], k: _T) -> tuple[NDArray[intp], NDArray[intp]]:
...
def tril_indices(n: int, k: int = ..., m: None | int = ...) -> tuple[NDArray[int_], NDArray[int_]]:
...
def tril_indices_from(arr: NDArray[Any], k: int = ...) -> tuple[NDArray[int_], NDArray[int_]]:
...
def triu_indices(n: int, k: int = ..., m: None | int = ...) -> tuple[NDArray[int_], NDArray[int_]]:
...
def triu_indices_from(arr: NDArray[Any], k: int = ...) -> tuple[NDArray[int_], NDArray[int_]]:
...

View file

@ -0,0 +1,218 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Container, Iterable
from typing import Any, Literal as L, Protocol, TypeVar, overload
from numpy import bool_, complexfloating, dtype, float64, floating, generic, integer
from numpy._typing import ArrayLike, DTypeLike, NBitBase, NDArray, _64Bit, _ArrayLike, _DTypeLikeComplex, _ScalarLike_co, _SupportsDType
_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
_SCT = TypeVar("_SCT", bound=generic)
_NBit1 = TypeVar("_NBit1", bound=NBitBase)
_NBit2 = TypeVar("_NBit2", bound=NBitBase)
class _SupportsReal(Protocol[_T_co]):
@property
def real(self) -> _T_co:
...
class _SupportsImag(Protocol[_T_co]):
@property
def imag(self) -> _T_co:
...
__all__: list[str]
def mintypecode(typechars: Iterable[str | ArrayLike], typeset: Container[str] = ..., default: str = ...) -> str:
...
@overload
def asfarray(a: object, dtype: None | type[float] = ...) -> NDArray[float64]:
...
@overload
def asfarray(a: Any, dtype: _DTypeLikeComplex) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def asfarray(a: Any, dtype: DTypeLike) -> NDArray[floating[Any]]:
...
@overload
def real(val: _SupportsReal[_T]) -> _T:
...
@overload
def real(val: ArrayLike) -> NDArray[Any]:
...
@overload
def imag(val: _SupportsImag[_T]) -> _T:
...
@overload
def imag(val: ArrayLike) -> NDArray[Any]:
...
@overload
def iscomplex(x: _ScalarLike_co) -> bool_:
...
@overload
def iscomplex(x: ArrayLike) -> NDArray[bool_]:
...
@overload
def isreal(x: _ScalarLike_co) -> bool_:
...
@overload
def isreal(x: ArrayLike) -> NDArray[bool_]:
...
def iscomplexobj(x: _SupportsDType[dtype[Any]] | ArrayLike) -> bool:
...
def isrealobj(x: _SupportsDType[dtype[Any]] | ArrayLike) -> bool:
...
@overload
def nan_to_num(x: _SCT, copy: bool = ..., nan: float = ..., posinf: None | float = ..., neginf: None | float = ...) -> _SCT:
...
@overload
def nan_to_num(x: _ScalarLike_co, copy: bool = ..., nan: float = ..., posinf: None | float = ..., neginf: None | float = ...) -> Any:
...
@overload
def nan_to_num(x: _ArrayLike[_SCT], copy: bool = ..., nan: float = ..., posinf: None | float = ..., neginf: None | float = ...) -> NDArray[_SCT]:
...
@overload
def nan_to_num(x: ArrayLike, copy: bool = ..., nan: float = ..., posinf: None | float = ..., neginf: None | float = ...) -> NDArray[Any]:
...
@overload
def real_if_close(a: _ArrayLike[complexfloating[_NBit1, _NBit1]], tol: float = ...) -> NDArray[floating[_NBit1]] | NDArray[complexfloating[_NBit1, _NBit1]]:
...
@overload
def real_if_close(a: _ArrayLike[_SCT], tol: float = ...) -> NDArray[_SCT]:
...
@overload
def real_if_close(a: ArrayLike, tol: float = ...) -> NDArray[Any]:
...
@overload
def typename(char: L['S1']) -> L['character']:
...
@overload
def typename(char: L['?']) -> L['bool']:
...
@overload
def typename(char: L['b']) -> L['signed char']:
...
@overload
def typename(char: L['B']) -> L['unsigned char']:
...
@overload
def typename(char: L['h']) -> L['short']:
...
@overload
def typename(char: L['H']) -> L['unsigned short']:
...
@overload
def typename(char: L['i']) -> L['integer']:
...
@overload
def typename(char: L['I']) -> L['unsigned integer']:
...
@overload
def typename(char: L['l']) -> L['long integer']:
...
@overload
def typename(char: L['L']) -> L['unsigned long integer']:
...
@overload
def typename(char: L['q']) -> L['long long integer']:
...
@overload
def typename(char: L['Q']) -> L['unsigned long long integer']:
...
@overload
def typename(char: L['f']) -> L['single precision']:
...
@overload
def typename(char: L['d']) -> L['double precision']:
...
@overload
def typename(char: L['g']) -> L['long precision']:
...
@overload
def typename(char: L['F']) -> L['complex single precision']:
...
@overload
def typename(char: L['D']) -> L['complex double precision']:
...
@overload
def typename(char: L['G']) -> L['complex long double precision']:
...
@overload
def typename(char: L['S']) -> L['string']:
...
@overload
def typename(char: L['U']) -> L['unicode']:
...
@overload
def typename(char: L['V']) -> L['void']:
...
@overload
def typename(char: L['O']) -> L['object']:
...
@overload
def common_type(*arrays: _SupportsDType[dtype[integer[Any]]]) -> type[floating[_64Bit]]:
...
@overload
def common_type(*arrays: _SupportsDType[dtype[floating[_NBit1]]]) -> type[floating[_NBit1]]:
...
@overload
def common_type(*arrays: _SupportsDType[dtype[integer[Any] | floating[_NBit1]]]) -> type[floating[_NBit1 | _64Bit]]:
...
@overload
def common_type(*arrays: _SupportsDType[dtype[floating[_NBit1] | complexfloating[_NBit2, _NBit2]]]) -> type[complexfloating[_NBit1 | _NBit2, _NBit1 | _NBit2]]:
...
@overload
def common_type(*arrays: _SupportsDType[dtype[integer[Any] | floating[_NBit1] | complexfloating[_NBit2, _NBit2]]]) -> type[complexfloating[_64Bit | _NBit1 | _NBit2, _64Bit | _NBit1 | _NBit2]]:
...

View file

@ -0,0 +1,50 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, TypeVar, overload
from numpy import bool_, floating, ndarray, object_
from numpy._typing import NDArray, _ArrayLikeFloat_co, _ArrayLikeObject_co, _FloatLike_co
_ArrayType = TypeVar("_ArrayType", bound=ndarray[Any, Any])
__all__: list[str]
@overload
def fix(x: _FloatLike_co, out: None = ...) -> floating[Any]:
...
@overload
def fix(x: _ArrayLikeFloat_co, out: None = ...) -> NDArray[floating[Any]]:
...
@overload
def fix(x: _ArrayLikeObject_co, out: None = ...) -> NDArray[object_]:
...
@overload
def fix(x: _ArrayLikeFloat_co | _ArrayLikeObject_co, out: _ArrayType) -> _ArrayType:
...
@overload
def isposinf(x: _FloatLike_co, out: None = ...) -> bool_:
...
@overload
def isposinf(x: _ArrayLikeFloat_co, out: None = ...) -> NDArray[bool_]:
...
@overload
def isposinf(x: _ArrayLikeFloat_co, out: _ArrayType) -> _ArrayType:
...
@overload
def isneginf(x: _FloatLike_co, out: None = ...) -> bool_:
...
@overload
def isneginf(x: _ArrayLikeFloat_co, out: None = ...) -> NDArray[bool_]:
...
@overload
def isneginf(x: _ArrayLikeFloat_co, out: _ArrayType) -> _ArrayType:
...

View file

@ -0,0 +1,65 @@
"""
This type stub file was generated by pyright.
"""
from ast import AST
from collections.abc import Callable, Mapping, Sequence
from typing import Any, Protocol, TypeVar, overload
from numpy import generic, ndarray
_T_contra = TypeVar("_T_contra", contravariant=True)
_FuncType = TypeVar("_FuncType", bound=Callable[..., Any])
class _SupportsWrite(Protocol[_T_contra]):
def write(self, s: _T_contra, /) -> Any:
...
__all__: list[str]
class _Deprecate:
old_name: None | str
new_name: None | str
message: None | str
def __init__(self, old_name: None | str = ..., new_name: None | str = ..., message: None | str = ...) -> None:
...
def __call__(self, func: _FuncType) -> _FuncType:
...
def get_include() -> str:
...
@overload
def deprecate(*, old_name: None | str = ..., new_name: None | str = ..., message: None | str = ...) -> _Deprecate:
...
@overload
def deprecate(func: _FuncType, /, old_name: None | str = ..., new_name: None | str = ..., message: None | str = ...) -> _FuncType:
...
def deprecate_with_doc(msg: None | str) -> _Deprecate:
...
def byte_bounds(a: generic | ndarray[Any, Any]) -> tuple[int, int]:
...
def who(vardict: None | Mapping[str, ndarray[Any, Any]] = ...) -> None:
...
def info(object: object = ..., maxwidth: int = ..., output: None | _SupportsWrite[str] = ..., toplevel: str = ...) -> None:
...
def source(object: object, output: None | _SupportsWrite[str] = ...) -> None:
...
def lookfor(what: str, module: None | str | Sequence[str] = ..., import_modules: bool = ..., regenerate: bool = ..., output: None | _SupportsWrite[str] = ...) -> None:
...
def safe_eval(source: str | AST) -> Any:
...
def show_runtime() -> None:
...