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,44 @@
"""
This type stub file was generated by pyright.
"""
from enum import Enum
__all__ = ["show"]
_built_with_meson = ...
class DisplayModes(Enum):
stdout = ...
dicts = ...
CONFIG = ...
def show(mode=...): # -> dict[str, Unknown] | None:
"""
Show libraries and system information on which NumPy was built
and is being used
Parameters
----------
mode : {`'stdout'`, `'dicts'`}, optional.
Indicates how to display the config information.
`'stdout'` prints to console, `'dicts'` returns a dictionary
of the configuration.
Returns
-------
out : {`dict`, `None`}
If mode is `'dicts'`, a dict is returned, else None
See Also
--------
get_include : Returns the directory containing NumPy C
header files.
Notes
-----
1. The `'stdout'` mode will give more readable
output if ``pyyaml`` is installed
"""
...

4443
typings/numpy/__init__.pyi Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,14 @@
"""
This type stub file was generated by pyright.
"""
""" Distributor init file
Distributors: you can add custom code here to support particular distributions
of numpy.
For example, this is a good place to put any checks for hardware requirements.
The numpy standard source distribution will not put code in this file, so you
can safely replace this file with your own version.
"""

View file

@ -0,0 +1,82 @@
"""
This type stub file was generated by pyright.
"""
import enum
from ._utils import set_module as _set_module
"""
Module defining global singleton classes.
This module raises a RuntimeError if an attempt to reload it is made. In that
way the identities of the classes defined here are fixed and will remain so
even if numpy itself is reloaded. In particular, a function like the following
will still work correctly after numpy is reloaded::
def foo(arg=np._NoValue):
if arg is np._NoValue:
...
That was not the case when the singleton classes were defined in the numpy
``__init__.py`` file. See gh-7844 for a discussion of the reload problem that
motivated this module.
"""
__all__ = ['_NoValue', '_CopyMode']
if '_is_loaded' in globals():
...
_is_loaded = ...
class _NoValueType:
"""Special keyword value.
The instance of this class may be used as the default value assigned to a
keyword if no other obvious default (e.g., `None`) is suitable,
Common reasons for using this keyword are:
- A new keyword is added to a function, and that function forwards its
inputs to another function or method which can be defined outside of
NumPy. For example, ``np.std(x)`` calls ``x.std``, so when a ``keepdims``
keyword was added that could only be forwarded if the user explicitly
specified ``keepdims``; downstream array libraries may not have added
the same keyword, so adding ``x.std(..., keepdims=keepdims)``
unconditionally could have broken previously working code.
- A keyword is being deprecated, and a deprecation warning must only be
emitted when the keyword is used.
"""
__instance = ...
def __new__(cls): # -> Self@_NoValueType:
...
def __repr__(self): # -> Literal['<no value>']:
...
_NoValue = ...
@_set_module("numpy")
class _CopyMode(enum.Enum):
"""
An enumeration for the copy modes supported
by numpy.copy() and numpy.array(). The following three modes are supported,
- ALWAYS: This means that a deep copy of the input
array will always be taken.
- IF_NEEDED: This means that a deep copy of the input
array will be taken only if necessary.
- NEVER: This means that the deep copy will never be taken.
If a copy cannot be avoided then a `ValueError` will be
raised.
Note that the buffer-protocol could in theory do copies. NumPy currently
assumes an object exporting the buffer protocol will never do this.
"""
ALWAYS = ...
IF_NEEDED = ...
NEVER = ...
def __bool__(self): # -> bool:
...

View file

@ -0,0 +1,4 @@
"""
This type stub file was generated by pyright.
"""

View file

@ -0,0 +1,18 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Iterable
from typing import Literal as L
__all__: list[str]
class PytestTester:
module_name: str
def __init__(self, module_name: str) -> None:
...
def __call__(self, label: L["fast", "full"] = ..., verbose: int = ..., extra_argv: None | Iterable[str] = ..., doctests: L[False] = ..., coverage: bool = ..., durations: int = ..., tests: None | Iterable[str] = ...) -> bool:
...

View file

@ -0,0 +1,104 @@
"""
This type stub file was generated by pyright.
"""
from __future__ import annotations
from .. import ufunc
from .._utils import set_module
from typing import TYPE_CHECKING, final
from ._nested_sequence import _NestedSequence as _NestedSequence
from ._nbit import _NBitByte as _NBitByte, _NBitDouble as _NBitDouble, _NBitHalf as _NBitHalf, _NBitInt as _NBitInt, _NBitIntC as _NBitIntC, _NBitIntP as _NBitIntP, _NBitLongDouble as _NBitLongDouble, _NBitLongLong as _NBitLongLong, _NBitShort as _NBitShort, _NBitSingle as _NBitSingle
from ._char_codes import _BoolCodes as _BoolCodes, _ByteCodes as _ByteCodes, _BytesCodes as _BytesCodes, _CDoubleCodes as _CDoubleCodes, _CLongDoubleCodes as _CLongDoubleCodes, _CSingleCodes as _CSingleCodes, _Complex128Codes as _Complex128Codes, _Complex64Codes as _Complex64Codes, _DT64Codes as _DT64Codes, _DoubleCodes as _DoubleCodes, _Float16Codes as _Float16Codes, _Float32Codes as _Float32Codes, _Float64Codes as _Float64Codes, _HalfCodes as _HalfCodes, _Int16Codes as _Int16Codes, _Int32Codes as _Int32Codes, _Int64Codes as _Int64Codes, _Int8Codes as _Int8Codes, _IntCCodes as _IntCCodes, _IntCodes as _IntCodes, _IntPCodes as _IntPCodes, _LongDoubleCodes as _LongDoubleCodes, _LongLongCodes as _LongLongCodes, _ObjectCodes as _ObjectCodes, _ShortCodes as _ShortCodes, _SingleCodes as _SingleCodes, _StrCodes as _StrCodes, _TD64Codes as _TD64Codes, _UByteCodes as _UByteCodes, _UInt16Codes as _UInt16Codes, _UInt32Codes as _UInt32Codes, _UInt64Codes as _UInt64Codes, _UInt8Codes as _UInt8Codes, _UIntCCodes as _UIntCCodes, _UIntCodes as _UIntCodes, _UIntPCodes as _UIntPCodes, _ULongLongCodes as _ULongLongCodes, _UShortCodes as _UShortCodes, _VoidCodes as _VoidCodes
from ._scalars import _BoolLike_co as _BoolLike_co, _CharLike_co as _CharLike_co, _ComplexLike_co as _ComplexLike_co, _FloatLike_co as _FloatLike_co, _IntLike_co as _IntLike_co, _NumberLike_co as _NumberLike_co, _ScalarLike_co as _ScalarLike_co, _TD64Like_co as _TD64Like_co, _UIntLike_co as _UIntLike_co, _VoidLike_co as _VoidLike_co
from ._shape import _Shape as _Shape, _ShapeLike as _ShapeLike
from ._dtype_like import DTypeLike as DTypeLike, _DTypeLike as _DTypeLike, _DTypeLikeBool as _DTypeLikeBool, _DTypeLikeBytes as _DTypeLikeBytes, _DTypeLikeComplex as _DTypeLikeComplex, _DTypeLikeComplex_co as _DTypeLikeComplex_co, _DTypeLikeDT64 as _DTypeLikeDT64, _DTypeLikeFloat as _DTypeLikeFloat, _DTypeLikeInt as _DTypeLikeInt, _DTypeLikeObject as _DTypeLikeObject, _DTypeLikeStr as _DTypeLikeStr, _DTypeLikeTD64 as _DTypeLikeTD64, _DTypeLikeUInt as _DTypeLikeUInt, _DTypeLikeVoid as _DTypeLikeVoid, _SupportsDType as _SupportsDType, _VoidDTypeLike as _VoidDTypeLike
from ._array_like import ArrayLike as ArrayLike, NDArray as NDArray, _ArrayLike as _ArrayLike, _ArrayLikeBool_co as _ArrayLikeBool_co, _ArrayLikeBytes_co as _ArrayLikeBytes_co, _ArrayLikeComplex_co as _ArrayLikeComplex_co, _ArrayLikeDT64_co as _ArrayLikeDT64_co, _ArrayLikeFloat_co as _ArrayLikeFloat_co, _ArrayLikeInt as _ArrayLikeInt, _ArrayLikeInt_co as _ArrayLikeInt_co, _ArrayLikeNumber_co as _ArrayLikeNumber_co, _ArrayLikeObject_co as _ArrayLikeObject_co, _ArrayLikeStr_co as _ArrayLikeStr_co, _ArrayLikeTD64_co as _ArrayLikeTD64_co, _ArrayLikeUInt_co as _ArrayLikeUInt_co, _ArrayLikeUnknown as _ArrayLikeUnknown, _ArrayLikeVoid_co as _ArrayLikeVoid_co, _FiniteNestedSequence as _FiniteNestedSequence, _SupportsArray as _SupportsArray, _SupportsArrayFunc as _SupportsArrayFunc, _UnknownType as _UnknownType
from ._ufunc import _GUFunc_Nin2_Nout1 as _GUFunc_Nin2_Nout1, _UFunc_Nin1_Nout1 as _UFunc_Nin1_Nout1, _UFunc_Nin1_Nout2 as _UFunc_Nin1_Nout2, _UFunc_Nin2_Nout1 as _UFunc_Nin2_Nout1, _UFunc_Nin2_Nout2 as _UFunc_Nin2_Nout2
"""Private counterpart of ``numpy.typing``."""
@final
@set_module("numpy.typing")
class NBitBase:
"""
A type representing `numpy.number` precision during static type checking.
Used exclusively for the purpose static type checking, `NBitBase`
represents the base of a hierarchical set of subclasses.
Each subsequent subclass is herein used for representing a lower level
of precision, *e.g.* ``64Bit > 32Bit > 16Bit``.
.. versionadded:: 1.20
Examples
--------
Below is a typical usage example: `NBitBase` is herein used for annotating
a function that takes a float and integer of arbitrary precision
as arguments and returns a new float of whichever precision is largest
(*e.g.* ``np.float16 + np.int64 -> np.float64``).
.. code-block:: python
>>> from __future__ import annotations
>>> from typing import TypeVar, TYPE_CHECKING
>>> import numpy as np
>>> import numpy.typing as npt
>>> T1 = TypeVar("T1", bound=npt.NBitBase)
>>> T2 = TypeVar("T2", bound=npt.NBitBase)
>>> def add(a: np.floating[T1], b: np.integer[T2]) -> np.floating[T1 | T2]:
... return a + b
>>> a = np.float16()
>>> b = np.int64()
>>> out = add(a, b)
>>> if TYPE_CHECKING:
... reveal_locals()
... # note: Revealed local types are:
... # note: a: numpy.floating[numpy.typing._16Bit*]
... # note: b: numpy.signedinteger[numpy.typing._64Bit*]
... # note: out: numpy.floating[numpy.typing._64Bit*]
"""
def __init_subclass__(cls) -> None:
...
class _256Bit(NBitBase):
...
class _128Bit(_256Bit):
...
class _96Bit(_128Bit):
...
class _80Bit(_96Bit):
...
class _64Bit(_80Bit):
...
class _32Bit(_64Bit):
...
class _16Bit(_32Bit):
...
class _8Bit(_16Bit):
...
if TYPE_CHECKING:
...
else:
...

View file

@ -0,0 +1,22 @@
"""
This type stub file was generated by pyright.
"""
"""A module for creating docstrings for sphinx ``data`` domains."""
_docstrings_list = ...
def add_newdoc(name: str, value: str, doc: str) -> None:
"""Append ``_docstrings_list`` with a docstring for `name`.
Parameters
----------
name : str
The name of the object.
value : str
A string-representation of the object.
doc : str
The docstring of the object.
"""
...
_docstrings = ...

View file

@ -0,0 +1,56 @@
"""
This type stub file was generated by pyright.
"""
import sys
from collections.abc import Buffer, Callable, Collection, Sequence
from typing import Any, Protocol, TypeVar, Union, runtime_checkable
from numpy import bool_, bytes_, complexfloating, datetime64, dtype, floating, generic, integer, ndarray, number, object_, str_, timedelta64, unsignedinteger, void
from ._nested_sequence import _NestedSequence
_T = TypeVar("_T")
_ScalarType = TypeVar("_ScalarType", bound=generic)
_ScalarType_co = TypeVar("_ScalarType_co", bound=generic, covariant=True)
_DType = TypeVar("_DType", bound=dtype[Any])
_DType_co = TypeVar("_DType_co", covariant=True, bound=dtype[Any])
NDArray = ndarray[Any, dtype[_ScalarType_co]]
@runtime_checkable
class _SupportsArray(Protocol[_DType_co]):
def __array__(self) -> ndarray[Any, _DType_co]:
...
@runtime_checkable
class _SupportsArrayFunc(Protocol):
"""A protocol class representing `~class.__array_function__`."""
def __array_function__(self, func: Callable[..., Any], types: Collection[type[Any]], args: tuple[Any, ...], kwargs: dict[str, Any]) -> object:
...
_FiniteNestedSequence = Union[_T, Sequence[_T], Sequence[Sequence[_T]], Sequence[Sequence[Sequence[_T]]], Sequence[Sequence[Sequence[Sequence[_T]]]],]
_ArrayLike = Union[_SupportsArray[dtype[_ScalarType]], _NestedSequence[_SupportsArray[dtype[_ScalarType]]],]
_DualArrayLike = Union[_SupportsArray[_DType], _NestedSequence[_SupportsArray[_DType]], _T, _NestedSequence[_T],]
if sys.version_info >= (3, 12):
ArrayLike = Buffer | _DualArrayLike[dtype[Any], Union[bool, int, float, complex, str, bytes],]
else:
...
_ArrayLikeBool_co = _DualArrayLike[dtype[bool_], bool,]
_ArrayLikeUInt_co = _DualArrayLike[dtype[Union[bool_, unsignedinteger[Any]]], bool,]
_ArrayLikeInt_co = _DualArrayLike[dtype[Union[bool_, integer[Any]]], Union[bool, int],]
_ArrayLikeFloat_co = _DualArrayLike[dtype[Union[bool_, integer[Any], floating[Any]]], Union[bool, int, float],]
_ArrayLikeComplex_co = _DualArrayLike[dtype[Union[bool_, integer[Any], floating[Any], complexfloating[Any, Any],]], Union[bool, int, float, complex],]
_ArrayLikeNumber_co = _DualArrayLike[dtype[Union[bool_, number[Any]]], Union[bool, int, float, complex],]
_ArrayLikeTD64_co = _DualArrayLike[dtype[Union[bool_, integer[Any], timedelta64]], Union[bool, int],]
_ArrayLikeDT64_co = Union[_SupportsArray[dtype[datetime64]], _NestedSequence[_SupportsArray[dtype[datetime64]]],]
_ArrayLikeObject_co = Union[_SupportsArray[dtype[object_]], _NestedSequence[_SupportsArray[dtype[object_]]],]
_ArrayLikeVoid_co = Union[_SupportsArray[dtype[void]], _NestedSequence[_SupportsArray[dtype[void]]],]
_ArrayLikeStr_co = _DualArrayLike[dtype[str_], str,]
_ArrayLikeBytes_co = _DualArrayLike[dtype[bytes_], bytes,]
_ArrayLikeInt = _DualArrayLike[dtype[integer[Any]], int,]
class _UnknownType:
...
_ArrayLikeUnknown = _DualArrayLike[dtype[_UnknownType], _UnknownType,]

View file

@ -0,0 +1,462 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, NoReturn, Protocol, TypeVar, overload
from numpy import bool_, complex128, complexfloating, float64, floating, generic, int8, int_, integer, number, signedinteger, timedelta64, unsignedinteger
from ._nbit import _NBitDouble, _NBitInt
from ._scalars import _BoolLike_co, _FloatLike_co, _IntLike_co, _NumberLike_co
from . import NBitBase
from ._array_like import NDArray
from ._nested_sequence import _NestedSequence
"""
A module with various ``typing.Protocol`` subclasses that implement
the ``__call__`` magic method.
See the `Mypy documentation`_ on protocols for more details.
.. _`Mypy documentation`: https://mypy.readthedocs.io/en/stable/protocols.html#callback-protocols
"""
_T1 = TypeVar("_T1")
_T2 = TypeVar("_T2")
_T1_contra = TypeVar("_T1_contra", contravariant=True)
_T2_contra = TypeVar("_T2_contra", contravariant=True)
_2Tuple = tuple[_T1, _T1]
_NBit1 = TypeVar("_NBit1", bound=NBitBase)
_NBit2 = TypeVar("_NBit2", bound=NBitBase)
_IntType = TypeVar("_IntType", bound=integer)
_FloatType = TypeVar("_FloatType", bound=floating)
_NumberType = TypeVar("_NumberType", bound=number)
_NumberType_co = TypeVar("_NumberType_co", covariant=True, bound=number)
_GenericType_co = TypeVar("_GenericType_co", covariant=True, bound=generic)
class _BoolOp(Protocol[_GenericType_co]):
@overload
def __call__(self, other: _BoolLike_co, /) -> _GenericType_co:
...
@overload
def __call__(self, other: int, /) -> int_:
...
@overload
def __call__(self, other: float, /) -> float64:
...
@overload
def __call__(self, other: complex, /) -> complex128:
...
@overload
def __call__(self, other: _NumberType, /) -> _NumberType:
...
class _BoolBitOp(Protocol[_GenericType_co]):
@overload
def __call__(self, other: _BoolLike_co, /) -> _GenericType_co:
...
@overload
def __call__(self, other: int, /) -> int_:
...
@overload
def __call__(self, other: _IntType, /) -> _IntType:
...
class _BoolSub(Protocol):
@overload
def __call__(self, other: bool, /) -> NoReturn:
...
@overload
def __call__(self, other: int, /) -> int_:
...
@overload
def __call__(self, other: float, /) -> float64:
...
@overload
def __call__(self, other: complex, /) -> complex128:
...
@overload
def __call__(self, other: _NumberType, /) -> _NumberType:
...
class _BoolTrueDiv(Protocol):
@overload
def __call__(self, other: float | _IntLike_co, /) -> float64:
...
@overload
def __call__(self, other: complex, /) -> complex128:
...
@overload
def __call__(self, other: _NumberType, /) -> _NumberType:
...
class _BoolMod(Protocol):
@overload
def __call__(self, other: _BoolLike_co, /) -> int8:
...
@overload
def __call__(self, other: int, /) -> int_:
...
@overload
def __call__(self, other: float, /) -> float64:
...
@overload
def __call__(self, other: _IntType, /) -> _IntType:
...
@overload
def __call__(self, other: _FloatType, /) -> _FloatType:
...
class _BoolDivMod(Protocol):
@overload
def __call__(self, other: _BoolLike_co, /) -> _2Tuple[int8]:
...
@overload
def __call__(self, other: int, /) -> _2Tuple[int_]:
...
@overload
def __call__(self, other: float, /) -> _2Tuple[floating[_NBit1 | _NBitDouble]]:
...
@overload
def __call__(self, other: _IntType, /) -> _2Tuple[_IntType]:
...
@overload
def __call__(self, other: _FloatType, /) -> _2Tuple[_FloatType]:
...
class _TD64Div(Protocol[_NumberType_co]):
@overload
def __call__(self, other: timedelta64, /) -> _NumberType_co:
...
@overload
def __call__(self, other: _BoolLike_co, /) -> NoReturn:
...
@overload
def __call__(self, other: _FloatLike_co, /) -> timedelta64:
...
class _IntTrueDiv(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> floating[_NBit1]:
...
@overload
def __call__(self, other: int, /) -> floating[_NBit1 | _NBitInt]:
...
@overload
def __call__(self, other: float, /) -> floating[_NBit1 | _NBitDouble]:
...
@overload
def __call__(self, other: complex, /) -> complexfloating[_NBit1 | _NBitDouble, _NBit1 | _NBitDouble]:
...
@overload
def __call__(self, other: integer[_NBit2], /) -> floating[_NBit1 | _NBit2]:
...
class _UnsignedIntOp(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> unsignedinteger[_NBit1]:
...
@overload
def __call__(self, other: int | signedinteger[Any], /) -> Any:
...
@overload
def __call__(self, other: float, /) -> floating[_NBit1 | _NBitDouble]:
...
@overload
def __call__(self, other: complex, /) -> complexfloating[_NBit1 | _NBitDouble, _NBit1 | _NBitDouble]:
...
@overload
def __call__(self, other: unsignedinteger[_NBit2], /) -> unsignedinteger[_NBit1 | _NBit2]:
...
class _UnsignedIntBitOp(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> unsignedinteger[_NBit1]:
...
@overload
def __call__(self, other: int, /) -> signedinteger[Any]:
...
@overload
def __call__(self, other: signedinteger[Any], /) -> signedinteger[Any]:
...
@overload
def __call__(self, other: unsignedinteger[_NBit2], /) -> unsignedinteger[_NBit1 | _NBit2]:
...
class _UnsignedIntMod(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> unsignedinteger[_NBit1]:
...
@overload
def __call__(self, other: int | signedinteger[Any], /) -> Any:
...
@overload
def __call__(self, other: float, /) -> floating[_NBit1 | _NBitDouble]:
...
@overload
def __call__(self, other: unsignedinteger[_NBit2], /) -> unsignedinteger[_NBit1 | _NBit2]:
...
class _UnsignedIntDivMod(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> _2Tuple[signedinteger[_NBit1]]:
...
@overload
def __call__(self, other: int | signedinteger[Any], /) -> _2Tuple[Any]:
...
@overload
def __call__(self, other: float, /) -> _2Tuple[floating[_NBit1 | _NBitDouble]]:
...
@overload
def __call__(self, other: unsignedinteger[_NBit2], /) -> _2Tuple[unsignedinteger[_NBit1 | _NBit2]]:
...
class _SignedIntOp(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> signedinteger[_NBit1]:
...
@overload
def __call__(self, other: int, /) -> signedinteger[_NBit1 | _NBitInt]:
...
@overload
def __call__(self, other: float, /) -> floating[_NBit1 | _NBitDouble]:
...
@overload
def __call__(self, other: complex, /) -> complexfloating[_NBit1 | _NBitDouble, _NBit1 | _NBitDouble]:
...
@overload
def __call__(self, other: signedinteger[_NBit2], /) -> signedinteger[_NBit1 | _NBit2]:
...
class _SignedIntBitOp(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> signedinteger[_NBit1]:
...
@overload
def __call__(self, other: int, /) -> signedinteger[_NBit1 | _NBitInt]:
...
@overload
def __call__(self, other: signedinteger[_NBit2], /) -> signedinteger[_NBit1 | _NBit2]:
...
class _SignedIntMod(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> signedinteger[_NBit1]:
...
@overload
def __call__(self, other: int, /) -> signedinteger[_NBit1 | _NBitInt]:
...
@overload
def __call__(self, other: float, /) -> floating[_NBit1 | _NBitDouble]:
...
@overload
def __call__(self, other: signedinteger[_NBit2], /) -> signedinteger[_NBit1 | _NBit2]:
...
class _SignedIntDivMod(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> _2Tuple[signedinteger[_NBit1]]:
...
@overload
def __call__(self, other: int, /) -> _2Tuple[signedinteger[_NBit1 | _NBitInt]]:
...
@overload
def __call__(self, other: float, /) -> _2Tuple[floating[_NBit1 | _NBitDouble]]:
...
@overload
def __call__(self, other: signedinteger[_NBit2], /) -> _2Tuple[signedinteger[_NBit1 | _NBit2]]:
...
class _FloatOp(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> floating[_NBit1]:
...
@overload
def __call__(self, other: int, /) -> floating[_NBit1 | _NBitInt]:
...
@overload
def __call__(self, other: float, /) -> floating[_NBit1 | _NBitDouble]:
...
@overload
def __call__(self, other: complex, /) -> complexfloating[_NBit1 | _NBitDouble, _NBit1 | _NBitDouble]:
...
@overload
def __call__(self, other: integer[_NBit2] | floating[_NBit2], /) -> floating[_NBit1 | _NBit2]:
...
class _FloatMod(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> floating[_NBit1]:
...
@overload
def __call__(self, other: int, /) -> floating[_NBit1 | _NBitInt]:
...
@overload
def __call__(self, other: float, /) -> floating[_NBit1 | _NBitDouble]:
...
@overload
def __call__(self, other: integer[_NBit2] | floating[_NBit2], /) -> floating[_NBit1 | _NBit2]:
...
class _FloatDivMod(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> _2Tuple[floating[_NBit1]]:
...
@overload
def __call__(self, other: int, /) -> _2Tuple[floating[_NBit1 | _NBitInt]]:
...
@overload
def __call__(self, other: float, /) -> _2Tuple[floating[_NBit1 | _NBitDouble]]:
...
@overload
def __call__(self, other: integer[_NBit2] | floating[_NBit2], /) -> _2Tuple[floating[_NBit1 | _NBit2]]:
...
class _ComplexOp(Protocol[_NBit1]):
@overload
def __call__(self, other: bool, /) -> complexfloating[_NBit1, _NBit1]:
...
@overload
def __call__(self, other: int, /) -> complexfloating[_NBit1 | _NBitInt, _NBit1 | _NBitInt]:
...
@overload
def __call__(self, other: complex, /) -> complexfloating[_NBit1 | _NBitDouble, _NBit1 | _NBitDouble]:
...
@overload
def __call__(self, other: (integer[_NBit2] | floating[_NBit2] | complexfloating[_NBit2, _NBit2]), /) -> complexfloating[_NBit1 | _NBit2, _NBit1 | _NBit2]:
...
class _NumberOp(Protocol):
def __call__(self, other: _NumberLike_co, /) -> Any:
...
class _SupportsLT(Protocol):
def __lt__(self, other: Any, /) -> object:
...
class _SupportsGT(Protocol):
def __gt__(self, other: Any, /) -> object:
...
class _ComparisonOp(Protocol[_T1_contra, _T2_contra]):
@overload
def __call__(self, other: _T1_contra, /) -> bool_:
...
@overload
def __call__(self, other: _T2_contra, /) -> NDArray[bool_]:
...
@overload
def __call__(self, other: _SupportsLT | _SupportsGT | _NestedSequence[_SupportsLT | _SupportsGT], /) -> Any:
...

View file

@ -0,0 +1,45 @@
"""
This type stub file was generated by pyright.
"""
from typing import Literal
_BoolCodes = Literal["?", "=?", "<?", ">?", "bool", "bool_", "bool8"]
_UInt8Codes = Literal["uint8", "u1", "=u1", "<u1", ">u1"]
_UInt16Codes = Literal["uint16", "u2", "=u2", "<u2", ">u2"]
_UInt32Codes = Literal["uint32", "u4", "=u4", "<u4", ">u4"]
_UInt64Codes = Literal["uint64", "u8", "=u8", "<u8", ">u8"]
_Int8Codes = Literal["int8", "i1", "=i1", "<i1", ">i1"]
_Int16Codes = Literal["int16", "i2", "=i2", "<i2", ">i2"]
_Int32Codes = Literal["int32", "i4", "=i4", "<i4", ">i4"]
_Int64Codes = Literal["int64", "i8", "=i8", "<i8", ">i8"]
_Float16Codes = Literal["float16", "f2", "=f2", "<f2", ">f2"]
_Float32Codes = Literal["float32", "f4", "=f4", "<f4", ">f4"]
_Float64Codes = Literal["float64", "f8", "=f8", "<f8", ">f8"]
_Complex64Codes = Literal["complex64", "c8", "=c8", "<c8", ">c8"]
_Complex128Codes = Literal["complex128", "c16", "=c16", "<c16", ">c16"]
_ByteCodes = Literal["byte", "b", "=b", "<b", ">b"]
_ShortCodes = Literal["short", "h", "=h", "<h", ">h"]
_IntCCodes = Literal["intc", "i", "=i", "<i", ">i"]
_IntPCodes = Literal["intp", "int0", "p", "=p", "<p", ">p"]
_IntCodes = Literal["long", "int", "int_", "l", "=l", "<l", ">l"]
_LongLongCodes = Literal["longlong", "q", "=q", "<q", ">q"]
_UByteCodes = Literal["ubyte", "B", "=B", "<B", ">B"]
_UShortCodes = Literal["ushort", "H", "=H", "<H", ">H"]
_UIntCCodes = Literal["uintc", "I", "=I", "<I", ">I"]
_UIntPCodes = Literal["uintp", "uint0", "P", "=P", "<P", ">P"]
_UIntCodes = Literal["ulong", "uint", "L", "=L", "<L", ">L"]
_ULongLongCodes = Literal["ulonglong", "Q", "=Q", "<Q", ">Q"]
_HalfCodes = Literal["half", "e", "=e", "<e", ">e"]
_SingleCodes = Literal["single", "f", "=f", "<f", ">f"]
_DoubleCodes = Literal["double", "float", "float_", "d", "=d", "<d", ">d"]
_LongDoubleCodes = Literal["longdouble", "longfloat", "g", "=g", "<g", ">g"]
_CSingleCodes = Literal["csingle", "singlecomplex", "F", "=F", "<F", ">F"]
_CDoubleCodes = Literal["cdouble", "complex", "complex_", "cfloat", "D", "=D", "<D", ">D"]
_CLongDoubleCodes = Literal["clongdouble", "clongfloat", "longcomplex", "G", "=G", "<G", ">G"]
_StrCodes = Literal["str", "str_", "str0", "unicode", "unicode_", "U", "=U", "<U", ">U"]
_BytesCodes = Literal["bytes", "bytes_", "bytes0", "S", "=S", "<S", ">S"]
_VoidCodes = Literal["void", "void0", "V", "=V", "<V", ">V"]
_ObjectCodes = Literal["object", "object_", "O", "=O", "<O", ">O"]
_DT64Codes = Literal["datetime64", "=datetime64", "<datetime64", ">datetime64", "datetime64[Y]", "=datetime64[Y]", "<datetime64[Y]", ">datetime64[Y]", "datetime64[M]", "=datetime64[M]", "<datetime64[M]", ">datetime64[M]", "datetime64[W]", "=datetime64[W]", "<datetime64[W]", ">datetime64[W]", "datetime64[D]", "=datetime64[D]", "<datetime64[D]", ">datetime64[D]", "datetime64[h]", "=datetime64[h]", "<datetime64[h]", ">datetime64[h]", "datetime64[m]", "=datetime64[m]", "<datetime64[m]", ">datetime64[m]", "datetime64[s]", "=datetime64[s]", "<datetime64[s]", ">datetime64[s]", "datetime64[ms]", "=datetime64[ms]", "<datetime64[ms]", ">datetime64[ms]", "datetime64[us]", "=datetime64[us]", "<datetime64[us]", ">datetime64[us]", "datetime64[ns]", "=datetime64[ns]", "<datetime64[ns]", ">datetime64[ns]", "datetime64[ps]", "=datetime64[ps]", "<datetime64[ps]", ">datetime64[ps]", "datetime64[fs]", "=datetime64[fs]", "<datetime64[fs]", ">datetime64[fs]", "datetime64[as]", "=datetime64[as]", "<datetime64[as]", ">datetime64[as]", "M", "=M", "<M", ">M", "M8", "=M8", "<M8", ">M8", "M8[Y]", "=M8[Y]", "<M8[Y]", ">M8[Y]", "M8[M]", "=M8[M]", "<M8[M]", ">M8[M]", "M8[W]", "=M8[W]", "<M8[W]", ">M8[W]", "M8[D]", "=M8[D]", "<M8[D]", ">M8[D]", "M8[h]", "=M8[h]", "<M8[h]", ">M8[h]", "M8[m]", "=M8[m]", "<M8[m]", ">M8[m]", "M8[s]", "=M8[s]", "<M8[s]", ">M8[s]", "M8[ms]", "=M8[ms]", "<M8[ms]", ">M8[ms]", "M8[us]", "=M8[us]", "<M8[us]", ">M8[us]", "M8[ns]", "=M8[ns]", "<M8[ns]", ">M8[ns]", "M8[ps]", "=M8[ps]", "<M8[ps]", ">M8[ps]", "M8[fs]", "=M8[fs]", "<M8[fs]", ">M8[fs]", "M8[as]", "=M8[as]", "<M8[as]", ">M8[as]",]
_TD64Codes = Literal["timedelta64", "=timedelta64", "<timedelta64", ">timedelta64", "timedelta64[Y]", "=timedelta64[Y]", "<timedelta64[Y]", ">timedelta64[Y]", "timedelta64[M]", "=timedelta64[M]", "<timedelta64[M]", ">timedelta64[M]", "timedelta64[W]", "=timedelta64[W]", "<timedelta64[W]", ">timedelta64[W]", "timedelta64[D]", "=timedelta64[D]", "<timedelta64[D]", ">timedelta64[D]", "timedelta64[h]", "=timedelta64[h]", "<timedelta64[h]", ">timedelta64[h]", "timedelta64[m]", "=timedelta64[m]", "<timedelta64[m]", ">timedelta64[m]", "timedelta64[s]", "=timedelta64[s]", "<timedelta64[s]", ">timedelta64[s]", "timedelta64[ms]", "=timedelta64[ms]", "<timedelta64[ms]", ">timedelta64[ms]", "timedelta64[us]", "=timedelta64[us]", "<timedelta64[us]", ">timedelta64[us]", "timedelta64[ns]", "=timedelta64[ns]", "<timedelta64[ns]", ">timedelta64[ns]", "timedelta64[ps]", "=timedelta64[ps]", "<timedelta64[ps]", ">timedelta64[ps]", "timedelta64[fs]", "=timedelta64[fs]", "<timedelta64[fs]", ">timedelta64[fs]", "timedelta64[as]", "=timedelta64[as]", "<timedelta64[as]", ">timedelta64[as]", "m", "=m", "<m", ">m", "m8", "=m8", "<m8", ">m8", "m8[Y]", "=m8[Y]", "<m8[Y]", ">m8[Y]", "m8[M]", "=m8[M]", "<m8[M]", ">m8[M]", "m8[W]", "=m8[W]", "<m8[W]", ">m8[W]", "m8[D]", "=m8[D]", "<m8[D]", ">m8[D]", "m8[h]", "=m8[h]", "<m8[h]", ">m8[h]", "m8[m]", "=m8[m]", "<m8[m]", ">m8[m]", "m8[s]", "=m8[s]", "<m8[s]", ">m8[s]", "m8[ms]", "=m8[ms]", "<m8[ms]", ">m8[ms]", "m8[us]", "=m8[us]", "<m8[us]", ">m8[us]", "m8[ns]", "=m8[ns]", "<m8[ns]", ">m8[ns]", "m8[ps]", "=m8[ps]", "<m8[ps]", ">m8[ps]", "m8[fs]", "=m8[fs]", "<m8[fs]", ">m8[fs]", "m8[as]", "=m8[as]", "<m8[as]", ">m8[as]",]

View file

@ -0,0 +1,50 @@
"""
This type stub file was generated by pyright.
"""
import numpy as np
from collections.abc import Sequence
from typing import Any, Protocol, Sequence, TypeVar, TypedDict, Union, runtime_checkable
from ._shape import _ShapeLike
from ._char_codes import _BoolCodes, _ByteCodes, _BytesCodes, _CDoubleCodes, _CLongDoubleCodes, _CSingleCodes, _Complex128Codes, _Complex64Codes, _DT64Codes, _DoubleCodes, _Float16Codes, _Float32Codes, _Float64Codes, _HalfCodes, _Int16Codes, _Int32Codes, _Int64Codes, _Int8Codes, _IntCCodes, _IntCodes, _IntPCodes, _LongDoubleCodes, _LongLongCodes, _ObjectCodes, _ShortCodes, _SingleCodes, _StrCodes, _TD64Codes, _UByteCodes, _UInt16Codes, _UInt32Codes, _UInt64Codes, _UInt8Codes, _UIntCCodes, _UIntCodes, _UIntPCodes, _ULongLongCodes, _UShortCodes, _VoidCodes
_SCT = TypeVar("_SCT", bound=np.generic)
_DType_co = TypeVar("_DType_co", covariant=True, bound=np.dtype[Any])
_DTypeLikeNested = Any
class _DTypeDictBase(TypedDict):
names: Sequence[str]
formats: Sequence[_DTypeLikeNested]
...
class _DTypeDict(_DTypeDictBase, total=False):
offsets: Sequence[int]
titles: Sequence[Any]
itemsize: int
aligned: bool
...
@runtime_checkable
class _SupportsDType(Protocol[_DType_co]):
@property
def dtype(self) -> _DType_co:
...
_DTypeLike = Union[np.dtype[_SCT], type[_SCT], _SupportsDType[np.dtype[_SCT]],]
_VoidDTypeLike = Union[tuple[_DTypeLikeNested, int], tuple[_DTypeLikeNested, _ShapeLike], list[Any], _DTypeDict, tuple[_DTypeLikeNested, _DTypeLikeNested],]
DTypeLike = Union[np.dtype[Any], None, type[Any], _SupportsDType[np.dtype[Any]], str, _VoidDTypeLike,]
_DTypeLikeBool = Union[type[bool], type[np.bool_], np.dtype[np.bool_], _SupportsDType[np.dtype[np.bool_]], _BoolCodes,]
_DTypeLikeUInt = Union[type[np.unsignedinteger], np.dtype[np.unsignedinteger], _SupportsDType[np.dtype[np.unsignedinteger]], _UInt8Codes, _UInt16Codes, _UInt32Codes, _UInt64Codes, _UByteCodes, _UShortCodes, _UIntCCodes, _UIntPCodes, _UIntCodes, _ULongLongCodes,]
_DTypeLikeInt = Union[type[int], type[np.signedinteger], np.dtype[np.signedinteger], _SupportsDType[np.dtype[np.signedinteger]], _Int8Codes, _Int16Codes, _Int32Codes, _Int64Codes, _ByteCodes, _ShortCodes, _IntCCodes, _IntPCodes, _IntCodes, _LongLongCodes,]
_DTypeLikeFloat = Union[type[float], type[np.floating], np.dtype[np.floating], _SupportsDType[np.dtype[np.floating]], _Float16Codes, _Float32Codes, _Float64Codes, _HalfCodes, _SingleCodes, _DoubleCodes, _LongDoubleCodes,]
_DTypeLikeComplex = Union[type[complex], type[np.complexfloating], np.dtype[np.complexfloating], _SupportsDType[np.dtype[np.complexfloating]], _Complex64Codes, _Complex128Codes, _CSingleCodes, _CDoubleCodes, _CLongDoubleCodes,]
_DTypeLikeDT64 = Union[type[np.timedelta64], np.dtype[np.timedelta64], _SupportsDType[np.dtype[np.timedelta64]], _TD64Codes,]
_DTypeLikeTD64 = Union[type[np.datetime64], np.dtype[np.datetime64], _SupportsDType[np.dtype[np.datetime64]], _DT64Codes,]
_DTypeLikeStr = Union[type[str], type[np.str_], np.dtype[np.str_], _SupportsDType[np.dtype[np.str_]], _StrCodes,]
_DTypeLikeBytes = Union[type[bytes], type[np.bytes_], np.dtype[np.bytes_], _SupportsDType[np.dtype[np.bytes_]], _BytesCodes,]
_DTypeLikeVoid = Union[type[np.void], np.dtype[np.void], _SupportsDType[np.dtype[np.void]], _VoidCodes, _VoidDTypeLike,]
_DTypeLikeObject = Union[type, np.dtype[np.object_], _SupportsDType[np.dtype[np.object_]], _ObjectCodes,]
_DTypeLikeComplex_co = Union[_DTypeLikeBool, _DTypeLikeUInt, _DTypeLikeInt, _DTypeLikeFloat, _DTypeLikeComplex,]

View file

@ -0,0 +1,25 @@
"""
This type stub file was generated by pyright.
"""
import numpy as np
from . import _128Bit, _256Bit, _80Bit, _96Bit
"""A module with platform-specific extended precision
`numpy.number` subclasses.
The subclasses are defined here (instead of ``__init__.pyi``) such
that they can be imported conditionally via the numpy's mypy plugin.
"""
uint128 = np.unsignedinteger[_128Bit]
uint256 = np.unsignedinteger[_256Bit]
int128 = np.signedinteger[_128Bit]
int256 = np.signedinteger[_256Bit]
float80 = np.floating[_80Bit]
float96 = np.floating[_96Bit]
float128 = np.floating[_128Bit]
float256 = np.floating[_256Bit]
complex160 = np.complexfloating[_80Bit, _80Bit]
complex192 = np.complexfloating[_96Bit, _96Bit]
complex256 = np.complexfloating[_128Bit, _128Bit]
complex512 = np.complexfloating[_256Bit, _256Bit]

View file

@ -0,0 +1,17 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any
"""A module with the precisions of platform-specific `~numpy.number`s."""
_NBitByte = Any
_NBitShort = Any
_NBitIntC = Any
_NBitIntP = Any
_NBitInt = Any
_NBitLongLong = Any
_NBitHalf = Any
_NBitSingle = Any
_NBitDouble = Any
_NBitLongDouble = Any

View file

@ -0,0 +1,81 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Iterator
from typing import Any, Protocol, TypeVar, runtime_checkable
"""A module containing the `_NestedSequence` protocol."""
__all__ = ["_NestedSequence"]
_T_co = TypeVar("_T_co", covariant=True)
@runtime_checkable
class _NestedSequence(Protocol[_T_co]):
"""A protocol for representing nested sequences.
Warning
-------
`_NestedSequence` currently does not work in combination with typevars,
*e.g.* ``def func(a: _NestedSequnce[T]) -> T: ...``.
See Also
--------
collections.abc.Sequence
ABCs for read-only and mutable :term:`sequences`.
Examples
--------
.. code-block:: python
>>> from __future__ import annotations
>>> from typing import TYPE_CHECKING
>>> import numpy as np
>>> from numpy._typing import _NestedSequence
>>> def get_dtype(seq: _NestedSequence[float]) -> np.dtype[np.float64]:
... return np.asarray(seq).dtype
>>> a = get_dtype([1.0])
>>> b = get_dtype([[1.0]])
>>> c = get_dtype([[[1.0]]])
>>> d = get_dtype([[[[1.0]]]])
>>> if TYPE_CHECKING:
... reveal_locals()
... # note: Revealed local types are:
... # note: a: numpy.dtype[numpy.floating[numpy._typing._64Bit]]
... # note: b: numpy.dtype[numpy.floating[numpy._typing._64Bit]]
... # note: c: numpy.dtype[numpy.floating[numpy._typing._64Bit]]
... # note: d: numpy.dtype[numpy.floating[numpy._typing._64Bit]]
"""
def __len__(self, /) -> int:
"""Implement ``len(self)``."""
...
def __getitem__(self, index: int, /) -> _T_co | _NestedSequence[_T_co]:
"""Implement ``self[x]``."""
...
def __contains__(self, x: object, /) -> bool:
"""Implement ``x in self``."""
...
def __iter__(self, /) -> Iterator[_T_co | _NestedSequence[_T_co]]:
"""Implement ``iter(self)``."""
...
def __reversed__(self, /) -> Iterator[_T_co | _NestedSequence[_T_co]]:
"""Implement ``reversed(self)``."""
...
def count(self, value: Any, /) -> int:
"""Return the number of occurrences of `value`."""
...
def index(self, value: Any, /) -> int:
"""Return the first index of `value`."""
...

View file

@ -0,0 +1,17 @@
"""
This type stub file was generated by pyright.
"""
import numpy as np
from typing import Any, Union
_CharLike_co = Union[str, bytes]
_BoolLike_co = Union[bool, np.bool_]
_UIntLike_co = Union[_BoolLike_co, np.unsignedinteger[Any]]
_IntLike_co = Union[_BoolLike_co, int, np.integer[Any]]
_FloatLike_co = Union[_IntLike_co, float, np.floating[Any]]
_ComplexLike_co = Union[_FloatLike_co, complex, np.complexfloating[Any, Any]]
_TD64Like_co = Union[_IntLike_co, np.timedelta64]
_NumberLike_co = Union[int, float, complex, np.number[Any], np.bool_]
_ScalarLike_co = Union[int, float, complex, str, bytes, np.generic,]
_VoidLike_co = Union[tuple[Any, ...], np.void]

View file

@ -0,0 +1,9 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Sequence
from typing import SupportsIndex, Union
_Shape = tuple[int, ...]
_ShapeLike = Union[SupportsIndex, Sequence[SupportsIndex]]

View file

@ -0,0 +1,335 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, Generic, Literal, Protocol, SupportsIndex, TypeVar, overload
from numpy import _CastingKind, _OrderKACF, ufunc
from numpy.typing import NDArray
from ._shape import _ShapeLike
from ._scalars import _ScalarLike_co
from ._array_like import ArrayLike, _ArrayLikeBool_co, _ArrayLikeInt_co
from ._dtype_like import DTypeLike
"""A module with private type-check-only `numpy.ufunc` subclasses.
The signatures of the ufuncs are too varied to reasonably type
with a single class. So instead, `ufunc` has been expanded into
four private subclasses, one for each combination of
`~ufunc.nin` and `~ufunc.nout`.
"""
_T = TypeVar("_T")
_2Tuple = tuple[_T, _T]
_3Tuple = tuple[_T, _T, _T]
_4Tuple = tuple[_T, _T, _T, _T]
_NTypes = TypeVar("_NTypes", bound=int)
_IDType = TypeVar("_IDType", bound=Any)
_NameType = TypeVar("_NameType", bound=str)
class _SupportsArrayUFunc(Protocol):
def __array_ufunc__(self, ufunc: ufunc, method: Literal["__call__", "reduce", "reduceat", "accumulate", "outer", "inner"], *inputs: Any, **kwargs: Any) -> Any:
...
class _UFunc_Nin1_Nout1(ufunc, Generic[_NameType, _NTypes, _IDType]):
@property
def __name__(self) -> _NameType:
...
@property
def ntypes(self) -> _NTypes:
...
@property
def identity(self) -> _IDType:
...
@property
def nin(self) -> Literal[1]:
...
@property
def nout(self) -> Literal[1]:
...
@property
def nargs(self) -> Literal[2]:
...
@property
def signature(self) -> None:
...
@property
def reduce(self) -> None:
...
@property
def accumulate(self) -> None:
...
@property
def reduceat(self) -> None:
...
@property
def outer(self) -> None:
...
@overload
def __call__(self, __x1: _ScalarLike_co, out: None = ..., *, where: None | _ArrayLikeBool_co = ..., casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _2Tuple[None | str] = ..., extobj: list[Any] = ...) -> Any:
...
@overload
def __call__(self, __x1: ArrayLike, out: None | NDArray[Any] | tuple[NDArray[Any]] = ..., *, where: None | _ArrayLikeBool_co = ..., casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _2Tuple[None | str] = ..., extobj: list[Any] = ...) -> NDArray[Any]:
...
@overload
def __call__(self, __x1: _SupportsArrayUFunc, out: None | NDArray[Any] | tuple[NDArray[Any]] = ..., *, where: None | _ArrayLikeBool_co = ..., casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _2Tuple[None | str] = ..., extobj: list[Any] = ...) -> Any:
...
def at(self, a: _SupportsArrayUFunc, indices: _ArrayLikeInt_co, /) -> None:
...
class _UFunc_Nin2_Nout1(ufunc, Generic[_NameType, _NTypes, _IDType]):
@property
def __name__(self) -> _NameType:
...
@property
def ntypes(self) -> _NTypes:
...
@property
def identity(self) -> _IDType:
...
@property
def nin(self) -> Literal[2]:
...
@property
def nout(self) -> Literal[1]:
...
@property
def nargs(self) -> Literal[3]:
...
@property
def signature(self) -> None:
...
@overload
def __call__(self, __x1: _ScalarLike_co, __x2: _ScalarLike_co, out: None = ..., *, where: None | _ArrayLikeBool_co = ..., casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _3Tuple[None | str] = ..., extobj: list[Any] = ...) -> Any:
...
@overload
def __call__(self, __x1: ArrayLike, __x2: ArrayLike, out: None | NDArray[Any] | tuple[NDArray[Any]] = ..., *, where: None | _ArrayLikeBool_co = ..., casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _3Tuple[None | str] = ..., extobj: list[Any] = ...) -> NDArray[Any]:
...
def at(self, a: NDArray[Any], indices: _ArrayLikeInt_co, b: ArrayLike, /) -> None:
...
def reduce(self, array: ArrayLike, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: None | NDArray[Any] = ..., keepdims: bool = ..., initial: Any = ..., where: _ArrayLikeBool_co = ...) -> Any:
...
def accumulate(self, array: ArrayLike, axis: SupportsIndex = ..., dtype: DTypeLike = ..., out: None | NDArray[Any] = ...) -> NDArray[Any]:
...
def reduceat(self, array: ArrayLike, indices: _ArrayLikeInt_co, axis: SupportsIndex = ..., dtype: DTypeLike = ..., out: None | NDArray[Any] = ...) -> NDArray[Any]:
...
@overload
def outer(self, A: _ScalarLike_co, B: _ScalarLike_co, /, *, out: None = ..., where: None | _ArrayLikeBool_co = ..., casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _3Tuple[None | str] = ..., extobj: list[Any] = ...) -> Any:
...
@overload
def outer(self, A: ArrayLike, B: ArrayLike, /, *, out: None | NDArray[Any] | tuple[NDArray[Any]] = ..., where: None | _ArrayLikeBool_co = ..., casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _3Tuple[None | str] = ..., extobj: list[Any] = ...) -> NDArray[Any]:
...
class _UFunc_Nin1_Nout2(ufunc, Generic[_NameType, _NTypes, _IDType]):
@property
def __name__(self) -> _NameType:
...
@property
def ntypes(self) -> _NTypes:
...
@property
def identity(self) -> _IDType:
...
@property
def nin(self) -> Literal[1]:
...
@property
def nout(self) -> Literal[2]:
...
@property
def nargs(self) -> Literal[3]:
...
@property
def signature(self) -> None:
...
@property
def at(self) -> None:
...
@property
def reduce(self) -> None:
...
@property
def accumulate(self) -> None:
...
@property
def reduceat(self) -> None:
...
@property
def outer(self) -> None:
...
@overload
def __call__(self, __x1: _ScalarLike_co, __out1: None = ..., __out2: None = ..., *, where: None | _ArrayLikeBool_co = ..., casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _3Tuple[None | str] = ..., extobj: list[Any] = ...) -> _2Tuple[Any]:
...
@overload
def __call__(self, __x1: ArrayLike, __out1: None | NDArray[Any] = ..., __out2: None | NDArray[Any] = ..., *, out: _2Tuple[NDArray[Any]] = ..., where: None | _ArrayLikeBool_co = ..., casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _3Tuple[None | str] = ..., extobj: list[Any] = ...) -> _2Tuple[NDArray[Any]]:
...
@overload
def __call__(self, __x1: _SupportsArrayUFunc, __out1: None | NDArray[Any] = ..., __out2: None | NDArray[Any] = ..., *, out: _2Tuple[NDArray[Any]] = ..., where: None | _ArrayLikeBool_co = ..., casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _3Tuple[None | str] = ..., extobj: list[Any] = ...) -> _2Tuple[Any]:
...
class _UFunc_Nin2_Nout2(ufunc, Generic[_NameType, _NTypes, _IDType]):
@property
def __name__(self) -> _NameType:
...
@property
def ntypes(self) -> _NTypes:
...
@property
def identity(self) -> _IDType:
...
@property
def nin(self) -> Literal[2]:
...
@property
def nout(self) -> Literal[2]:
...
@property
def nargs(self) -> Literal[4]:
...
@property
def signature(self) -> None:
...
@property
def at(self) -> None:
...
@property
def reduce(self) -> None:
...
@property
def accumulate(self) -> None:
...
@property
def reduceat(self) -> None:
...
@property
def outer(self) -> None:
...
@overload
def __call__(self, __x1: _ScalarLike_co, __x2: _ScalarLike_co, __out1: None = ..., __out2: None = ..., *, where: None | _ArrayLikeBool_co = ..., casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _4Tuple[None | str] = ..., extobj: list[Any] = ...) -> _2Tuple[Any]:
...
@overload
def __call__(self, __x1: ArrayLike, __x2: ArrayLike, __out1: None | NDArray[Any] = ..., __out2: None | NDArray[Any] = ..., *, out: _2Tuple[NDArray[Any]] = ..., where: None | _ArrayLikeBool_co = ..., casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _4Tuple[None | str] = ..., extobj: list[Any] = ...) -> _2Tuple[NDArray[Any]]:
...
class _GUFunc_Nin2_Nout1(ufunc, Generic[_NameType, _NTypes, _IDType]):
@property
def __name__(self) -> _NameType:
...
@property
def ntypes(self) -> _NTypes:
...
@property
def identity(self) -> _IDType:
...
@property
def nin(self) -> Literal[2]:
...
@property
def nout(self) -> Literal[1]:
...
@property
def nargs(self) -> Literal[3]:
...
@property
def signature(self) -> Literal["(n?,k),(k,m?)->(n?,m?)"]:
...
@property
def reduce(self) -> None:
...
@property
def accumulate(self) -> None:
...
@property
def reduceat(self) -> None:
...
@property
def outer(self) -> None:
...
@property
def at(self) -> None:
...
@overload
def __call__(self, __x1: ArrayLike, __x2: ArrayLike, out: None = ..., *, casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _3Tuple[None | str] = ..., extobj: list[Any] = ..., axes: list[_2Tuple[SupportsIndex]] = ...) -> Any:
...
@overload
def __call__(self, __x1: ArrayLike, __x2: ArrayLike, out: NDArray[Any] | tuple[NDArray[Any]], *, casting: _CastingKind = ..., order: _OrderKACF = ..., dtype: DTypeLike = ..., subok: bool = ..., signature: str | _3Tuple[None | str] = ..., extobj: list[Any] = ..., axes: list[_2Tuple[SupportsIndex]] = ...) -> NDArray[Any]:
...

View file

@ -0,0 +1,28 @@
"""
This type stub file was generated by pyright.
"""
from ._convertions import asbytes, asunicode
"""
This is a module for defining private helpers which do not depend on the
rest of NumPy.
Everything in here must be self-contained so that it can be
imported anywhere else without creating circular imports.
If a utility requires the import of NumPy, it probably belongs
in ``numpy.core``.
"""
def set_module(module): # -> (func: Unknown) -> Unknown:
"""Private decorator for overriding __module__ on a function or class.
Example usage::
@set_module('numpy')
def example():
pass
assert example.__module__ == 'numpy'
"""
...

View file

@ -0,0 +1,15 @@
"""
This type stub file was generated by pyright.
"""
"""
A set of methods retained from np.compat module that
are still used across codebase.
"""
__all__ = ["asunicode", "asbytes"]
def asunicode(s): # -> str:
...
def asbytes(s): # -> bytes:
...

View file

@ -0,0 +1,123 @@
"""
This type stub file was generated by pyright.
"""
"""Subset of inspect module from upstream python
We use this instead of upstream because upstream inspect is slow to import, and
significantly contributes to numpy import times. Importing this copy has almost
no overhead.
"""
__all__ = ['getargspec', 'formatargspec']
def ismethod(object): # -> bool:
"""Return true if the object is an instance method.
Instance method objects provide these attributes:
__doc__ documentation string
__name__ name with which this method was defined
im_class class object in which this method belongs
im_func function object containing implementation of method
im_self instance to which this method is bound, or None
"""
...
def isfunction(object): # -> bool:
"""Return true if the object is a user-defined function.
Function objects provide these attributes:
__doc__ documentation string
__name__ name with which this function was defined
func_code code object containing compiled function bytecode
func_defaults tuple of any default values for arguments
func_doc (same as __doc__)
func_globals global namespace in which this function was defined
func_name (same as __name__)
"""
...
def iscode(object): # -> bool:
"""Return true if the object is a code object.
Code objects provide these attributes:
co_argcount number of arguments (not including * or ** args)
co_code string of raw compiled bytecode
co_consts tuple of constants used in the bytecode
co_filename name of file in which this code object was created
co_firstlineno number of first line in Python source code
co_flags bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg
co_lnotab encoded mapping of line numbers to bytecode indices
co_name name with which this code object was defined
co_names tuple of names of local variables
co_nlocals number of local variables
co_stacksize virtual machine stack space required
co_varnames tuple of names of arguments and local variables
"""
...
def getargs(co): # -> tuple[list[Unknown], Unknown | None, Unknown | None]:
"""Get information about the arguments accepted by a code object.
Three things are returned: (args, varargs, varkw), where 'args' is
a list of argument names (possibly containing nested lists), and
'varargs' and 'varkw' are the names of the * and ** arguments or None.
"""
...
def getargspec(func): # -> tuple[list[Unknown], Unknown | None, Unknown | None, Unknown]:
"""Get the names and default values of a function's arguments.
A tuple of four things is returned: (args, varargs, varkw, defaults).
'args' is a list of the argument names (it may contain nested lists).
'varargs' and 'varkw' are the names of the * and ** arguments or None.
'defaults' is an n-tuple of the default values of the last n arguments.
"""
...
def getargvalues(frame): # -> tuple[list[Unknown], Unknown | None, Unknown | None, Unknown]:
"""Get information about arguments passed into a particular frame.
A tuple of four things is returned: (args, varargs, varkw, locals).
'args' is a list of the argument names (it may contain nested lists).
'varargs' and 'varkw' are the names of the * and ** arguments or None.
'locals' is the locals dictionary of the given frame.
"""
...
def joinseq(seq): # -> str:
...
def strseq(object, convert, join=...):
"""Recursively walk a sequence, stringifying each element.
"""
...
def formatargspec(args, varargs=..., varkw=..., defaults=..., formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=..., join=...): # -> LiteralString:
"""Format an argument spec from the 4 values returned by getargspec.
The first four arguments are (args, varargs, varkw, defaults). The
other four arguments are the corresponding optional formatting functions
that are called to turn names and values into strings. The ninth
argument is an optional function to format the sequence of arguments.
"""
...
def formatargvalues(args, varargs, varkw, locals, formatarg=..., formatvarargs=..., formatvarkw=..., formatvalue=..., join=...): # -> LiteralString:
"""Format an argument spec from the 4 values returned by getargvalues.
The first four arguments are (args, varargs, varkw, locals). The
next four arguments are the corresponding optional formatting functions
that are called to turn names and values into strings. The ninth
argument is an optional function to format the sequence of arguments.
"""
...

View file

@ -0,0 +1,152 @@
"""
This type stub file was generated by pyright.
"""
import warnings
from ._constants import e, inf, nan, pi
from ._creation_functions import arange, asarray, empty, empty_like, eye, from_dlpack, full, full_like, linspace, meshgrid, ones, ones_like, tril, triu, zeros, zeros_like
from ._data_type_functions import astype, broadcast_arrays, broadcast_to, can_cast, finfo, iinfo, isdtype, result_type
from ._dtypes import bool, complex128, complex64, float32, float64, int16, int32, int64, int8, uint16, uint32, uint64, uint8
from ._elementwise_functions import abs, acos, acosh, add, asin, asinh, atan, atan2, atanh, bitwise_and, bitwise_invert, bitwise_left_shift, bitwise_or, bitwise_right_shift, bitwise_xor, ceil, conj, cos, cosh, divide, equal, exp, expm1, floor, floor_divide, greater, greater_equal, imag, isfinite, isinf, isnan, less, less_equal, log, log10, log1p, log2, logaddexp, logical_and, logical_not, logical_or, logical_xor, multiply, negative, not_equal, positive, pow, real, remainder, round, sign, sin, sinh, sqrt, square, subtract, tan, tanh, trunc
from ._indexing_functions import take
from . import linalg
from .linalg import matmul, matrix_transpose, tensordot, vecdot
from ._manipulation_functions import concat, expand_dims, flip, permute_dims, reshape, roll, squeeze, stack
from ._searching_functions import argmax, argmin, nonzero, where
from ._set_functions import unique_all, unique_counts, unique_inverse, unique_values
from ._sorting_functions import argsort, sort
from ._statistical_functions import max, mean, min, prod, std, sum, var
from ._utility_functions import all, any
"""
A NumPy sub-namespace that conforms to the Python array API standard.
This submodule accompanies NEP 47, which proposes its inclusion in NumPy. It
is still considered experimental, and will issue a warning when imported.
This is a proof-of-concept namespace that wraps the corresponding NumPy
functions to give a conforming implementation of the Python array API standard
(https://data-apis.github.io/array-api/latest/). The standard is currently in
an RFC phase and comments on it are both welcome and encouraged. Comments
should be made either at https://github.com/data-apis/array-api or at
https://github.com/data-apis/consortium-feedback/discussions.
NumPy already follows the proposed spec for the most part, so this module
serves mostly as a thin wrapper around it. However, NumPy also implements a
lot of behavior that is not included in the spec, so this serves as a
restricted subset of the API. Only those functions that are part of the spec
are included in this namespace, and all functions are given with the exact
signature given in the spec, including the use of position-only arguments, and
omitting any extra keyword arguments implemented by NumPy but not part of the
spec. The behavior of some functions is also modified from the NumPy behavior
to conform to the standard. Note that the underlying array object itself is
wrapped in a wrapper Array() class, but is otherwise unchanged. This submodule
is implemented in pure Python with no C extensions.
The array API spec is designed as a "minimal API subset" and explicitly allows
libraries to include behaviors not specified by it. But users of this module
that intend to write portable code should be aware that only those behaviors
that are listed in the spec are guaranteed to be implemented across libraries.
Consequently, the NumPy implementation was chosen to be both conforming and
minimal, so that users can use this implementation of the array API namespace
and be sure that behaviors that it defines will be available in conforming
namespaces from other libraries.
A few notes about the current state of this submodule:
- There is a test suite that tests modules against the array API standard at
https://github.com/data-apis/array-api-tests. The test suite is still a work
in progress, but the existing tests pass on this module, with a few
exceptions:
- DLPack support (see https://github.com/data-apis/array-api/pull/106) is
not included here, as it requires a full implementation in NumPy proper
first.
The test suite is not yet complete, and even the tests that exist are not
guaranteed to give a comprehensive coverage of the spec. Therefore, when
reviewing and using this submodule, you should refer to the standard
documents themselves. There are some tests in numpy.array_api.tests, but
they primarily focus on things that are not tested by the official array API
test suite.
- There is a custom array object, numpy.array_api.Array, which is returned by
all functions in this module. All functions in the array API namespace
implicitly assume that they will only receive this object as input. The only
way to create instances of this object is to use one of the array creation
functions. It does not have a public constructor on the object itself. The
object is a small wrapper class around numpy.ndarray. The main purpose of it
is to restrict the namespace of the array object to only those dtypes and
only those methods that are required by the spec, as well as to limit/change
certain behavior that differs in the spec. In particular:
- The array API namespace does not have scalar objects, only 0-D arrays.
Operations on Array that would create a scalar in NumPy create a 0-D
array.
- Indexing: Only a subset of indices supported by NumPy are required by the
spec. The Array object restricts indexing to only allow those types of
indices that are required by the spec. See the docstring of the
numpy.array_api.Array._validate_indices helper function for more
information.
- Type promotion: Some type promotion rules are different in the spec. In
particular, the spec does not have any value-based casting. The spec also
does not require cross-kind casting, like integer -> floating-point. Only
those promotions that are explicitly required by the array API
specification are allowed in this module. See NEP 47 for more info.
- Functions do not automatically call asarray() on their input, and will not
work if the input type is not Array. The exception is array creation
functions, and Python operators on the Array object, which accept Python
scalars of the same type as the array dtype.
- All functions include type annotations, corresponding to those given in the
spec (see _typing.py for definitions of some custom types). These do not
currently fully pass mypy due to some limitations in mypy.
- Dtype objects are just the NumPy dtype objects, e.g., float64 =
np.dtype('float64'). The spec does not require any behavior on these dtype
objects other than that they be accessible by name and be comparable by
equality, but it was considered too much extra complexity to create custom
objects to represent dtypes.
- All places where the implementations in this submodule are known to deviate
from their corresponding functions in NumPy are marked with "# Note:"
comments.
Still TODO in this module are:
- DLPack support for numpy.ndarray is still in progress. See
https://github.com/numpy/numpy/pull/19083.
- The copy=False keyword argument to asarray() is not yet implemented. This
requires support in numpy.asarray() first.
- Some functions are not yet fully tested in the array API test suite, and may
require updates that are not yet known until the tests are written.
- The spec is still in an RFC phase and may still have minor updates, which
will need to be reflected here.
- Complex number support in array API spec is planned but not yet finalized,
as are the fft extension and certain linear algebra functions such as eig
that require complex dtypes.
"""
__array_api_version__ = ...
__all__ = ["__array_api_version__"]
__all__ += ["e", "inf", "nan", "pi"]
__all__ += ["asarray", "arange", "empty", "empty_like", "eye", "from_dlpack", "full", "full_like", "linspace", "meshgrid", "ones", "ones_like", "tril", "triu", "zeros", "zeros_like"]
__all__ += ["astype", "broadcast_arrays", "broadcast_to", "can_cast", "finfo", "iinfo", "result_type"]
__all__ += ["int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "float32", "float64", "bool"]
__all__ += ["abs", "acos", "acosh", "add", "asin", "asinh", "atan", "atan2", "atanh", "bitwise_and", "bitwise_left_shift", "bitwise_invert", "bitwise_or", "bitwise_right_shift", "bitwise_xor", "ceil", "cos", "cosh", "divide", "equal", "exp", "expm1", "floor", "floor_divide", "greater", "greater_equal", "isfinite", "isinf", "isnan", "less", "less_equal", "log", "log1p", "log2", "log10", "logaddexp", "logical_and", "logical_not", "logical_or", "logical_xor", "multiply", "negative", "not_equal", "positive", "pow", "remainder", "round", "sign", "sin", "sinh", "square", "sqrt", "subtract", "tan", "tanh", "trunc"]
__all__ += ["take"]
__all__ += ["linalg"]
__all__ += ["matmul", "tensordot", "matrix_transpose", "vecdot"]
__all__ += ["concat", "expand_dims", "flip", "permute_dims", "reshape", "roll", "squeeze", "stack"]
__all__ += ["argmax", "argmin", "nonzero", "where"]
__all__ += ["unique_all", "unique_counts", "unique_inverse", "unique_values"]
__all__ += ["argsort", "sort"]
__all__ += ["max", "mean", "min", "prod", "std", "sum", "var"]
__all__ += ["all", "any"]

View file

@ -0,0 +1,476 @@
"""
This type stub file was generated by pyright.
"""
import types
import numpy.typing as npt
import numpy as np
from enum import IntEnum
from typing import Any, Optional, TYPE_CHECKING, Tuple, Union
from ._typing import Any, Device, Dtype, PyCapsule
"""
Wrapper class around the ndarray object for the array API standard.
The array API standard defines some behaviors differently than ndarray, in
particular, type promotion rules are different (the standard has no
value-based casting). The standard also specifies a more limited subset of
array methods and functionalities than are implemented on ndarray. Since the
goal of the array_api namespace is to be a minimal implementation of the array
API standard, we need to define a separate wrapper class for the array_api
namespace.
The standard compliant class is only a wrapper class. It is *not* a subclass
of ndarray.
"""
if TYPE_CHECKING:
...
class Array:
"""
n-d array object for the array API namespace.
See the docstring of :py:obj:`np.ndarray <numpy.ndarray>` for more
information.
This is a wrapper around numpy.ndarray that restricts the usage to only
those things that are required by the array API namespace. Note,
attributes on this object that start with a single underscore are not part
of the API specification and should only be used internally. This object
should not be constructed directly. Rather, use one of the creation
functions, such as asarray().
"""
_array: np.ndarray[Any, Any]
def __new__(cls, *args, **kwargs):
...
def __str__(self: Array, /) -> str:
"""
Performs the operation __str__.
"""
...
def __repr__(self: Array, /) -> str:
"""
Performs the operation __repr__.
"""
...
def __array__(self, dtype: None | np.dtype[Any] = ...) -> npt.NDArray[Any]:
"""
Warning: this method is NOT part of the array API spec. Implementers
of other libraries need not include it, and users should not assume it
will be present in other implementations.
"""
...
def __abs__(self: Array, /) -> Array:
"""
Performs the operation __abs__.
"""
...
def __add__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __add__.
"""
...
def __and__(self: Array, other: Union[int, bool, Array], /) -> Array:
"""
Performs the operation __and__.
"""
...
def __array_namespace__(self: Array, /, *, api_version: Optional[str] = ...) -> types.ModuleType:
...
def __bool__(self: Array, /) -> bool:
"""
Performs the operation __bool__.
"""
...
def __complex__(self: Array, /) -> complex:
"""
Performs the operation __complex__.
"""
...
def __dlpack__(self: Array, /, *, stream: None = ...) -> PyCapsule:
"""
Performs the operation __dlpack__.
"""
...
def __dlpack_device__(self: Array, /) -> Tuple[IntEnum, int]:
"""
Performs the operation __dlpack_device__.
"""
...
def __eq__(self: Array, other: Union[int, float, bool, Array], /) -> Array:
"""
Performs the operation __eq__.
"""
...
def __float__(self: Array, /) -> float:
"""
Performs the operation __float__.
"""
...
def __floordiv__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __floordiv__.
"""
...
def __ge__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __ge__.
"""
...
def __getitem__(self: Array, key: Union[int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], Array], /) -> Array:
"""
Performs the operation __getitem__.
"""
...
def __gt__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __gt__.
"""
...
def __int__(self: Array, /) -> int:
"""
Performs the operation __int__.
"""
...
def __index__(self: Array, /) -> int:
"""
Performs the operation __index__.
"""
...
def __invert__(self: Array, /) -> Array:
"""
Performs the operation __invert__.
"""
...
def __le__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __le__.
"""
...
def __lshift__(self: Array, other: Union[int, Array], /) -> Array:
"""
Performs the operation __lshift__.
"""
...
def __lt__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __lt__.
"""
...
def __matmul__(self: Array, other: Array, /) -> Array:
"""
Performs the operation __matmul__.
"""
...
def __mod__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __mod__.
"""
...
def __mul__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __mul__.
"""
...
def __ne__(self: Array, other: Union[int, float, bool, Array], /) -> Array:
"""
Performs the operation __ne__.
"""
...
def __neg__(self: Array, /) -> Array:
"""
Performs the operation __neg__.
"""
...
def __or__(self: Array, other: Union[int, bool, Array], /) -> Array:
"""
Performs the operation __or__.
"""
...
def __pos__(self: Array, /) -> Array:
"""
Performs the operation __pos__.
"""
...
def __pow__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __pow__.
"""
...
def __rshift__(self: Array, other: Union[int, Array], /) -> Array:
"""
Performs the operation __rshift__.
"""
...
def __setitem__(self, key: Union[int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], Array], value: Union[int, float, bool, Array], /) -> None:
"""
Performs the operation __setitem__.
"""
...
def __sub__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __sub__.
"""
...
def __truediv__(self: Array, other: Union[float, Array], /) -> Array:
"""
Performs the operation __truediv__.
"""
...
def __xor__(self: Array, other: Union[int, bool, Array], /) -> Array:
"""
Performs the operation __xor__.
"""
...
def __iadd__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __iadd__.
"""
...
def __radd__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __radd__.
"""
...
def __iand__(self: Array, other: Union[int, bool, Array], /) -> Array:
"""
Performs the operation __iand__.
"""
...
def __rand__(self: Array, other: Union[int, bool, Array], /) -> Array:
"""
Performs the operation __rand__.
"""
...
def __ifloordiv__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __ifloordiv__.
"""
...
def __rfloordiv__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __rfloordiv__.
"""
...
def __ilshift__(self: Array, other: Union[int, Array], /) -> Array:
"""
Performs the operation __ilshift__.
"""
...
def __rlshift__(self: Array, other: Union[int, Array], /) -> Array:
"""
Performs the operation __rlshift__.
"""
...
def __imatmul__(self: Array, other: Array, /) -> Array:
"""
Performs the operation __imatmul__.
"""
...
def __rmatmul__(self: Array, other: Array, /) -> Array:
"""
Performs the operation __rmatmul__.
"""
...
def __imod__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __imod__.
"""
...
def __rmod__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __rmod__.
"""
...
def __imul__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __imul__.
"""
...
def __rmul__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __rmul__.
"""
...
def __ior__(self: Array, other: Union[int, bool, Array], /) -> Array:
"""
Performs the operation __ior__.
"""
...
def __ror__(self: Array, other: Union[int, bool, Array], /) -> Array:
"""
Performs the operation __ror__.
"""
...
def __ipow__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __ipow__.
"""
...
def __rpow__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __rpow__.
"""
...
def __irshift__(self: Array, other: Union[int, Array], /) -> Array:
"""
Performs the operation __irshift__.
"""
...
def __rrshift__(self: Array, other: Union[int, Array], /) -> Array:
"""
Performs the operation __rrshift__.
"""
...
def __isub__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __isub__.
"""
...
def __rsub__(self: Array, other: Union[int, float, Array], /) -> Array:
"""
Performs the operation __rsub__.
"""
...
def __itruediv__(self: Array, other: Union[float, Array], /) -> Array:
"""
Performs the operation __itruediv__.
"""
...
def __rtruediv__(self: Array, other: Union[float, Array], /) -> Array:
"""
Performs the operation __rtruediv__.
"""
...
def __ixor__(self: Array, other: Union[int, bool, Array], /) -> Array:
"""
Performs the operation __ixor__.
"""
...
def __rxor__(self: Array, other: Union[int, bool, Array], /) -> Array:
"""
Performs the operation __rxor__.
"""
...
def to_device(self: Array, device: Device, /, stream: None = ...) -> Array:
...
@property
def dtype(self) -> Dtype:
"""
Array API compatible wrapper for :py:meth:`np.ndarray.dtype <numpy.ndarray.dtype>`.
See its docstring for more information.
"""
...
@property
def device(self) -> Device:
...
@property
def mT(self) -> Array:
...
@property
def ndim(self) -> int:
"""
Array API compatible wrapper for :py:meth:`np.ndarray.ndim <numpy.ndarray.ndim>`.
See its docstring for more information.
"""
...
@property
def shape(self) -> Tuple[int, ...]:
"""
Array API compatible wrapper for :py:meth:`np.ndarray.shape <numpy.ndarray.shape>`.
See its docstring for more information.
"""
...
@property
def size(self) -> int:
"""
Array API compatible wrapper for :py:meth:`np.ndarray.size <numpy.ndarray.size>`.
See its docstring for more information.
"""
...
@property
def T(self) -> Array:
"""
Array API compatible wrapper for :py:meth:`np.ndarray.T <numpy.ndarray.T>`.
See its docstring for more information.
"""
...

View file

@ -0,0 +1,8 @@
"""
This type stub file was generated by pyright.
"""
e = ...
inf = ...
nan = ...
pi = ...

View file

@ -0,0 +1,133 @@
"""
This type stub file was generated by pyright.
"""
import numpy as np
from typing import List, Optional, TYPE_CHECKING, Tuple, Union
from ._typing import Array, Device, Dtype, NestedSequence, SupportsBufferProtocol
if TYPE_CHECKING:
...
def asarray(obj: Union[Array, bool, int, float, NestedSequence[bool | int | float], SupportsBufferProtocol,], /, *, dtype: Optional[Dtype] = ..., device: Optional[Device] = ..., copy: Optional[Union[bool, np._CopyMode]] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.asarray <numpy.asarray>`.
See its docstring for more information.
"""
...
def arange(start: Union[int, float], /, stop: Optional[Union[int, float]] = ..., step: Union[int, float] = ..., *, dtype: Optional[Dtype] = ..., device: Optional[Device] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.arange <numpy.arange>`.
See its docstring for more information.
"""
...
def empty(shape: Union[int, Tuple[int, ...]], *, dtype: Optional[Dtype] = ..., device: Optional[Device] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.empty <numpy.empty>`.
See its docstring for more information.
"""
...
def empty_like(x: Array, /, *, dtype: Optional[Dtype] = ..., device: Optional[Device] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.empty_like <numpy.empty_like>`.
See its docstring for more information.
"""
...
def eye(n_rows: int, n_cols: Optional[int] = ..., /, *, k: int = ..., dtype: Optional[Dtype] = ..., device: Optional[Device] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.eye <numpy.eye>`.
See its docstring for more information.
"""
...
def from_dlpack(x: object, /) -> Array:
...
def full(shape: Union[int, Tuple[int, ...]], fill_value: Union[int, float], *, dtype: Optional[Dtype] = ..., device: Optional[Device] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.full <numpy.full>`.
See its docstring for more information.
"""
...
def full_like(x: Array, /, fill_value: Union[int, float], *, dtype: Optional[Dtype] = ..., device: Optional[Device] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.full_like <numpy.full_like>`.
See its docstring for more information.
"""
...
def linspace(start: Union[int, float], stop: Union[int, float], /, num: int, *, dtype: Optional[Dtype] = ..., device: Optional[Device] = ..., endpoint: bool = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.linspace <numpy.linspace>`.
See its docstring for more information.
"""
...
def meshgrid(*arrays: Array, indexing: str = ...) -> List[Array]:
"""
Array API compatible wrapper for :py:func:`np.meshgrid <numpy.meshgrid>`.
See its docstring for more information.
"""
...
def ones(shape: Union[int, Tuple[int, ...]], *, dtype: Optional[Dtype] = ..., device: Optional[Device] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.ones <numpy.ones>`.
See its docstring for more information.
"""
...
def ones_like(x: Array, /, *, dtype: Optional[Dtype] = ..., device: Optional[Device] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.ones_like <numpy.ones_like>`.
See its docstring for more information.
"""
...
def tril(x: Array, /, *, k: int = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.tril <numpy.tril>`.
See its docstring for more information.
"""
...
def triu(x: Array, /, *, k: int = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.triu <numpy.triu>`.
See its docstring for more information.
"""
...
def zeros(shape: Union[int, Tuple[int, ...]], *, dtype: Optional[Dtype] = ..., device: Optional[Device] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.zeros <numpy.zeros>`.
See its docstring for more information.
"""
...
def zeros_like(x: Array, /, *, dtype: Optional[Dtype] = ..., device: Optional[Device] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.zeros_like <numpy.zeros_like>`.
See its docstring for more information.
"""
...

View file

@ -0,0 +1,92 @@
"""
This type stub file was generated by pyright.
"""
from ._array_object import Array
from dataclasses import dataclass
from typing import List, TYPE_CHECKING, Tuple, Union
from ._typing import Dtype
if TYPE_CHECKING:
...
def astype(x: Array, dtype: Dtype, /, *, copy: bool = ...) -> Array:
...
def broadcast_arrays(*arrays: Array) -> List[Array]:
"""
Array API compatible wrapper for :py:func:`np.broadcast_arrays <numpy.broadcast_arrays>`.
See its docstring for more information.
"""
...
def broadcast_to(x: Array, /, shape: Tuple[int, ...]) -> Array:
"""
Array API compatible wrapper for :py:func:`np.broadcast_to <numpy.broadcast_to>`.
See its docstring for more information.
"""
...
def can_cast(from_: Union[Dtype, Array], to: Dtype, /) -> bool:
"""
Array API compatible wrapper for :py:func:`np.can_cast <numpy.can_cast>`.
See its docstring for more information.
"""
...
@dataclass
class finfo_object:
bits: int
eps: float
max: float
min: float
smallest_normal: float
dtype: Dtype
...
@dataclass
class iinfo_object:
bits: int
max: int
min: int
dtype: Dtype
...
def finfo(type: Union[Dtype, Array], /) -> finfo_object:
"""
Array API compatible wrapper for :py:func:`np.finfo <numpy.finfo>`.
See its docstring for more information.
"""
...
def iinfo(type: Union[Dtype, Array], /) -> iinfo_object:
"""
Array API compatible wrapper for :py:func:`np.iinfo <numpy.iinfo>`.
See its docstring for more information.
"""
...
def isdtype(dtype: Dtype, kind: Union[Dtype, str, Tuple[Union[Dtype, str], ...]]) -> bool:
"""
Returns a boolean indicating whether a provided dtype is of a specified data type ``kind``.
See
https://data-apis.org/array-api/latest/API_specification/generated/array_api.isdtype.html
for more details
"""
...
def result_type(*arrays_and_dtypes: Union[Array, Dtype]) -> Dtype:
"""
Array API compatible wrapper for :py:func:`np.result_type <numpy.result_type>`.
See its docstring for more information.
"""
...

View file

@ -0,0 +1,30 @@
"""
This type stub file was generated by pyright.
"""
int8 = ...
int16 = ...
int32 = ...
int64 = ...
uint8 = ...
uint16 = ...
uint32 = ...
uint64 = ...
float32 = ...
float64 = ...
complex64 = ...
complex128 = ...
bool = ...
_all_dtypes = ...
_boolean_dtypes = ...
_real_floating_dtypes = ...
_floating_dtypes = ...
_complex_floating_dtypes = ...
_integer_dtypes = ...
_signed_integer_dtypes = ...
_unsigned_integer_dtypes = ...
_integer_or_boolean_dtypes = ...
_real_numeric_dtypes = ...
_numeric_dtypes = ...
_dtype_categories = ...
_promotion_table = ...

View file

@ -0,0 +1,478 @@
"""
This type stub file was generated by pyright.
"""
from ._array_object import Array
def abs(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.abs <numpy.abs>`.
See its docstring for more information.
"""
...
def acos(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.arccos <numpy.arccos>`.
See its docstring for more information.
"""
...
def acosh(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.arccosh <numpy.arccosh>`.
See its docstring for more information.
"""
...
def add(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.add <numpy.add>`.
See its docstring for more information.
"""
...
def asin(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.arcsin <numpy.arcsin>`.
See its docstring for more information.
"""
...
def asinh(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.arcsinh <numpy.arcsinh>`.
See its docstring for more information.
"""
...
def atan(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.arctan <numpy.arctan>`.
See its docstring for more information.
"""
...
def atan2(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.arctan2 <numpy.arctan2>`.
See its docstring for more information.
"""
...
def atanh(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.arctanh <numpy.arctanh>`.
See its docstring for more information.
"""
...
def bitwise_and(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.bitwise_and <numpy.bitwise_and>`.
See its docstring for more information.
"""
...
def bitwise_left_shift(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.left_shift <numpy.left_shift>`.
See its docstring for more information.
"""
...
def bitwise_invert(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.invert <numpy.invert>`.
See its docstring for more information.
"""
...
def bitwise_or(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.bitwise_or <numpy.bitwise_or>`.
See its docstring for more information.
"""
...
def bitwise_right_shift(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.right_shift <numpy.right_shift>`.
See its docstring for more information.
"""
...
def bitwise_xor(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.bitwise_xor <numpy.bitwise_xor>`.
See its docstring for more information.
"""
...
def ceil(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.ceil <numpy.ceil>`.
See its docstring for more information.
"""
...
def conj(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.conj <numpy.conj>`.
See its docstring for more information.
"""
...
def cos(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.cos <numpy.cos>`.
See its docstring for more information.
"""
...
def cosh(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.cosh <numpy.cosh>`.
See its docstring for more information.
"""
...
def divide(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.divide <numpy.divide>`.
See its docstring for more information.
"""
...
def equal(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.equal <numpy.equal>`.
See its docstring for more information.
"""
...
def exp(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.exp <numpy.exp>`.
See its docstring for more information.
"""
...
def expm1(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.expm1 <numpy.expm1>`.
See its docstring for more information.
"""
...
def floor(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.floor <numpy.floor>`.
See its docstring for more information.
"""
...
def floor_divide(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.floor_divide <numpy.floor_divide>`.
See its docstring for more information.
"""
...
def greater(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.greater <numpy.greater>`.
See its docstring for more information.
"""
...
def greater_equal(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.greater_equal <numpy.greater_equal>`.
See its docstring for more information.
"""
...
def imag(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.imag <numpy.imag>`.
See its docstring for more information.
"""
...
def isfinite(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.isfinite <numpy.isfinite>`.
See its docstring for more information.
"""
...
def isinf(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.isinf <numpy.isinf>`.
See its docstring for more information.
"""
...
def isnan(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.isnan <numpy.isnan>`.
See its docstring for more information.
"""
...
def less(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.less <numpy.less>`.
See its docstring for more information.
"""
...
def less_equal(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.less_equal <numpy.less_equal>`.
See its docstring for more information.
"""
...
def log(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.log <numpy.log>`.
See its docstring for more information.
"""
...
def log1p(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.log1p <numpy.log1p>`.
See its docstring for more information.
"""
...
def log2(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.log2 <numpy.log2>`.
See its docstring for more information.
"""
...
def log10(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.log10 <numpy.log10>`.
See its docstring for more information.
"""
...
def logaddexp(x1: Array, x2: Array) -> Array:
"""
Array API compatible wrapper for :py:func:`np.logaddexp <numpy.logaddexp>`.
See its docstring for more information.
"""
...
def logical_and(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.logical_and <numpy.logical_and>`.
See its docstring for more information.
"""
...
def logical_not(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.logical_not <numpy.logical_not>`.
See its docstring for more information.
"""
...
def logical_or(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.logical_or <numpy.logical_or>`.
See its docstring for more information.
"""
...
def logical_xor(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.logical_xor <numpy.logical_xor>`.
See its docstring for more information.
"""
...
def multiply(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.multiply <numpy.multiply>`.
See its docstring for more information.
"""
...
def negative(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.negative <numpy.negative>`.
See its docstring for more information.
"""
...
def not_equal(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.not_equal <numpy.not_equal>`.
See its docstring for more information.
"""
...
def positive(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.positive <numpy.positive>`.
See its docstring for more information.
"""
...
def pow(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.power <numpy.power>`.
See its docstring for more information.
"""
...
def real(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.real <numpy.real>`.
See its docstring for more information.
"""
...
def remainder(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.remainder <numpy.remainder>`.
See its docstring for more information.
"""
...
def round(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.round <numpy.round>`.
See its docstring for more information.
"""
...
def sign(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.sign <numpy.sign>`.
See its docstring for more information.
"""
...
def sin(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.sin <numpy.sin>`.
See its docstring for more information.
"""
...
def sinh(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.sinh <numpy.sinh>`.
See its docstring for more information.
"""
...
def square(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.square <numpy.square>`.
See its docstring for more information.
"""
...
def sqrt(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.sqrt <numpy.sqrt>`.
See its docstring for more information.
"""
...
def subtract(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.subtract <numpy.subtract>`.
See its docstring for more information.
"""
...
def tan(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.tan <numpy.tan>`.
See its docstring for more information.
"""
...
def tanh(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.tanh <numpy.tanh>`.
See its docstring for more information.
"""
...
def trunc(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.trunc <numpy.trunc>`.
See its docstring for more information.
"""
...

View file

@ -0,0 +1,14 @@
"""
This type stub file was generated by pyright.
"""
from ._array_object import Array
def take(x: Array, indices: Array, /, *, axis: Optional[int] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.take <numpy.take>`.
See its docstring for more information.
"""
...

View file

@ -0,0 +1,71 @@
"""
This type stub file was generated by pyright.
"""
from ._array_object import Array
from typing import List, Optional, Tuple, Union
def concat(arrays: Union[Tuple[Array, ...], List[Array]], /, *, axis: Optional[int] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.concatenate <numpy.concatenate>`.
See its docstring for more information.
"""
...
def expand_dims(x: Array, /, *, axis: int) -> Array:
"""
Array API compatible wrapper for :py:func:`np.expand_dims <numpy.expand_dims>`.
See its docstring for more information.
"""
...
def flip(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.flip <numpy.flip>`.
See its docstring for more information.
"""
...
def permute_dims(x: Array, /, axes: Tuple[int, ...]) -> Array:
"""
Array API compatible wrapper for :py:func:`np.transpose <numpy.transpose>`.
See its docstring for more information.
"""
...
def reshape(x: Array, /, shape: Tuple[int, ...], *, copy: Optional[Bool] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.reshape <numpy.reshape>`.
See its docstring for more information.
"""
...
def roll(x: Array, /, shift: Union[int, Tuple[int, ...]], *, axis: Optional[Union[int, Tuple[int, ...]]] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.roll <numpy.roll>`.
See its docstring for more information.
"""
...
def squeeze(x: Array, /, axis: Union[int, Tuple[int, ...]]) -> Array:
"""
Array API compatible wrapper for :py:func:`np.squeeze <numpy.squeeze>`.
See its docstring for more information.
"""
...
def stack(arrays: Union[Tuple[Array, ...], List[Array]], /, *, axis: int = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.stack <numpy.stack>`.
See its docstring for more information.
"""
...

View file

@ -0,0 +1,39 @@
"""
This type stub file was generated by pyright.
"""
from ._array_object import Array
from typing import Optional, Tuple
def argmax(x: Array, /, *, axis: Optional[int] = ..., keepdims: bool = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.argmax <numpy.argmax>`.
See its docstring for more information.
"""
...
def argmin(x: Array, /, *, axis: Optional[int] = ..., keepdims: bool = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.argmin <numpy.argmin>`.
See its docstring for more information.
"""
...
def nonzero(x: Array, /) -> Tuple[Array, ...]:
"""
Array API compatible wrapper for :py:func:`np.nonzero <numpy.nonzero>`.
See its docstring for more information.
"""
...
def where(condition: Array, x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.where <numpy.where>`.
See its docstring for more information.
"""
...

View file

@ -0,0 +1,54 @@
"""
This type stub file was generated by pyright.
"""
from ._array_object import Array
from typing import NamedTuple
class UniqueAllResult(NamedTuple):
values: Array
indices: Array
inverse_indices: Array
counts: Array
...
class UniqueCountsResult(NamedTuple):
values: Array
counts: Array
...
class UniqueInverseResult(NamedTuple):
values: Array
inverse_indices: Array
...
def unique_all(x: Array, /) -> UniqueAllResult:
"""
Array API compatible wrapper for :py:func:`np.unique <numpy.unique>`.
See its docstring for more information.
"""
...
def unique_counts(x: Array, /) -> UniqueCountsResult:
...
def unique_inverse(x: Array, /) -> UniqueInverseResult:
"""
Array API compatible wrapper for :py:func:`np.unique <numpy.unique>`.
See its docstring for more information.
"""
...
def unique_values(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.unique <numpy.unique>`.
See its docstring for more information.
"""
...

View file

@ -0,0 +1,22 @@
"""
This type stub file was generated by pyright.
"""
from ._array_object import Array
def argsort(x: Array, /, *, axis: int = ..., descending: bool = ..., stable: bool = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.argsort <numpy.argsort>`.
See its docstring for more information.
"""
...
def sort(x: Array, /, *, axis: int = ..., descending: bool = ..., stable: bool = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.sort <numpy.sort>`.
See its docstring for more information.
"""
...

View file

@ -0,0 +1,31 @@
"""
This type stub file was generated by pyright.
"""
from ._array_object import Array
from typing import Optional, TYPE_CHECKING, Tuple, Union
from ._typing import Dtype
if TYPE_CHECKING:
...
def max(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = ..., keepdims: bool = ...) -> Array:
...
def mean(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = ..., keepdims: bool = ...) -> Array:
...
def min(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = ..., keepdims: bool = ...) -> Array:
...
def prod(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = ..., dtype: Optional[Dtype] = ..., keepdims: bool = ...) -> Array:
...
def std(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = ..., correction: Union[int, float] = ..., keepdims: bool = ...) -> Array:
...
def sum(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = ..., dtype: Optional[Dtype] = ..., keepdims: bool = ...) -> Array:
...
def var(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = ..., correction: Union[int, float] = ..., keepdims: bool = ...) -> Array:
...

View file

@ -0,0 +1,39 @@
"""
This type stub file was generated by pyright.
"""
import sys
from typing import Any, Literal, Protocol, TypeVar, Union
from numpy import dtype, float32, float64, int16, int32, int64, int8, uint16, uint32, uint64, uint8
"""
This file defines the types for type annotations.
These names aren't part of the module namespace, but they are used in the
annotations in the function signatures. The functions in the module are only
valid for inputs that match the given type annotations.
"""
__all__ = ["Array", "Device", "Dtype", "SupportsDLPack", "SupportsBufferProtocol", "PyCapsule"]
_T_co = TypeVar("_T_co", covariant=True)
class NestedSequence(Protocol[_T_co]):
def __getitem__(self, key: int, /) -> _T_co | NestedSequence[_T_co]:
...
def __len__(self, /) -> int:
...
Device = Literal["cpu"]
Dtype = dtype[Union[int8, int16, int32, int64, uint8, uint16, uint32, uint64, float32, float64,]]
if sys.version_info >= (3, 12):
...
else:
...
PyCapsule = Any
class SupportsDLPack(Protocol):
def __dlpack__(self, /, *, stream: None = ...) -> PyCapsule:
...

View file

@ -0,0 +1,23 @@
"""
This type stub file was generated by pyright.
"""
from ._array_object import Array
from typing import Optional, Tuple, Union
def all(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = ..., keepdims: bool = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.all <numpy.all>`.
See its docstring for more information.
"""
...
def any(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = ..., keepdims: bool = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.any <numpy.any>`.
See its docstring for more information.
"""
...

View file

@ -0,0 +1,200 @@
"""
This type stub file was generated by pyright.
"""
from ._array_object import Array
from typing import NamedTuple, TYPE_CHECKING
from ._typing import Dtype, Literal, Optional, Sequence, Tuple, Union
if TYPE_CHECKING:
...
class EighResult(NamedTuple):
eigenvalues: Array
eigenvectors: Array
...
class QRResult(NamedTuple):
Q: Array
R: Array
...
class SlogdetResult(NamedTuple):
sign: Array
logabsdet: Array
...
class SVDResult(NamedTuple):
U: Array
S: Array
Vh: Array
...
def cholesky(x: Array, /, *, upper: bool = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.linalg.cholesky <numpy.linalg.cholesky>`.
See its docstring for more information.
"""
...
def cross(x1: Array, x2: Array, /, *, axis: int = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.cross <numpy.cross>`.
See its docstring for more information.
"""
...
def det(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.linalg.det <numpy.linalg.det>`.
See its docstring for more information.
"""
...
def diagonal(x: Array, /, *, offset: int = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.diagonal <numpy.diagonal>`.
See its docstring for more information.
"""
...
def eigh(x: Array, /) -> EighResult:
"""
Array API compatible wrapper for :py:func:`np.linalg.eigh <numpy.linalg.eigh>`.
See its docstring for more information.
"""
...
def eigvalsh(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.linalg.eigvalsh <numpy.linalg.eigvalsh>`.
See its docstring for more information.
"""
...
def inv(x: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.linalg.inv <numpy.linalg.inv>`.
See its docstring for more information.
"""
...
def matmul(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.matmul <numpy.matmul>`.
See its docstring for more information.
"""
...
def matrix_norm(x: Array, /, *, keepdims: bool = ..., ord: Optional[Union[int, float, Literal[fro, nuc]]] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.linalg.norm <numpy.linalg.norm>`.
See its docstring for more information.
"""
...
def matrix_power(x: Array, n: int, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.matrix_power <numpy.matrix_power>`.
See its docstring for more information.
"""
...
def matrix_rank(x: Array, /, *, rtol: Optional[Union[float, Array]] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.matrix_rank <numpy.matrix_rank>`.
See its docstring for more information.
"""
...
def matrix_transpose(x: Array, /) -> Array:
...
def outer(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.outer <numpy.outer>`.
See its docstring for more information.
"""
...
def pinv(x: Array, /, *, rtol: Optional[Union[float, Array]] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.linalg.pinv <numpy.linalg.pinv>`.
See its docstring for more information.
"""
...
def qr(x: Array, /, *, mode: Literal[reduced, complete] = ...) -> QRResult:
"""
Array API compatible wrapper for :py:func:`np.linalg.qr <numpy.linalg.qr>`.
See its docstring for more information.
"""
...
def slogdet(x: Array, /) -> SlogdetResult:
"""
Array API compatible wrapper for :py:func:`np.linalg.slogdet <numpy.linalg.slogdet>`.
See its docstring for more information.
"""
...
def solve(x1: Array, x2: Array, /) -> Array:
"""
Array API compatible wrapper for :py:func:`np.linalg.solve <numpy.linalg.solve>`.
See its docstring for more information.
"""
...
def svd(x: Array, /, *, full_matrices: bool = ...) -> SVDResult:
"""
Array API compatible wrapper for :py:func:`np.linalg.svd <numpy.linalg.svd>`.
See its docstring for more information.
"""
...
def svdvals(x: Array, /) -> Union[Array, Tuple[Array, ...]]:
...
def tensordot(x1: Array, x2: Array, /, *, axes: Union[int, Tuple[Sequence[int], Sequence[int]]] = ...) -> Array:
...
def trace(x: Array, /, *, offset: int = ..., dtype: Optional[Dtype] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.trace <numpy.trace>`.
See its docstring for more information.
"""
...
def vecdot(x1: Array, x2: Array, /, *, axis: int = ...) -> Array:
...
def vector_norm(x: Array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = ..., keepdims: bool = ..., ord: Optional[Union[int, float]] = ...) -> Array:
"""
Array API compatible wrapper for :py:func:`np.linalg.norm <numpy.linalg.norm>`.
See its docstring for more information.
"""
...
__all__ = ['cholesky', 'cross', 'det', 'diagonal', 'eigh', 'eigvalsh', 'inv', 'matmul', 'matrix_norm', 'matrix_power', 'matrix_rank', 'matrix_transpose', 'outer', 'pinv', 'qr', 'slogdet', 'solve', 'svd', 'svdvals', 'tensordot', 'trace', 'vecdot', 'vector_norm']

View file

@ -0,0 +1,20 @@
"""
This type stub file was generated by pyright.
"""
from .._utils import _inspect
from .._utils._inspect import formatargspec, getargspec
from . import py3k
from .py3k import *
"""
Compatibility module.
This module contains duplicated code from Python itself or 3rd party
extensions, which may be included for the following reasons:
* compatibility
* we may only need a small subset of the copied library/module
"""
__all__ = []

View file

@ -0,0 +1,110 @@
"""
This type stub file was generated by pyright.
"""
import os
"""
Python 3.X compatibility tools.
While this file was originally intended for Python 2 -> 3 transition,
it is now used to create a compatibility layer between different
minor versions of Python 3.
While the active version of numpy may not support a given version of python, we
allow downstream libraries to continue to use these shims for forward
compatibility with numpy while they transition their code to newer versions of
Python.
"""
__all__ = ['bytes', 'asbytes', 'isfileobj', 'getexception', 'strchar', 'unicode', 'asunicode', 'asbytes_nested', 'asunicode_nested', 'asstr', 'open_latin1', 'long', 'basestring', 'sixu', 'integer_types', 'is_pathlib_path', 'npy_load_module', 'Path', 'pickle', 'contextlib_nullcontext', 'os_fspath', 'os_PathLike']
long = int
integer_types = ...
basestring = str
unicode = str
bytes = bytes
def asunicode(s): # -> str:
...
def asbytes(s): # -> bytes:
...
def asstr(s): # -> str:
...
def isfileobj(f): # -> bool:
...
def open_latin1(filename, mode=...): # -> IO[Any]:
...
def sixu(s):
...
strchar = ...
def getexception(): # -> BaseException | None:
...
def asbytes_nested(x): # -> list[Unknown] | bytes:
...
def asunicode_nested(x): # -> list[Unknown] | str:
...
def is_pathlib_path(obj): # -> bool:
"""
Check whether obj is a `pathlib.Path` object.
Prefer using ``isinstance(obj, os.PathLike)`` instead of this function.
"""
...
class contextlib_nullcontext:
"""Context manager that does no additional processing.
Used as a stand-in for a normal context manager, when a particular
block of code is only sometimes used with a normal context manager:
cm = optional_cm if condition else nullcontext()
with cm:
# Perform operation, using optional_cm if condition is True
.. note::
Prefer using `contextlib.nullcontext` instead of this context manager.
"""
def __init__(self, enter_result=...) -> None:
...
def __enter__(self): # -> None:
...
def __exit__(self, *excinfo): # -> None:
...
def npy_load_module(name, fn, info=...): # -> ModuleType:
"""
Load a module. Uses ``load_module`` which will be deprecated in python
3.12. An alternative that uses ``exec_module`` is in
numpy.distutils.misc_util.exec_mod_from_location
.. versionadded:: 1.11.2
Parameters
----------
name : str
Full module name.
fn : str
Path to module file.
info : tuple, optional
Only here for backward compatibility with Python 2.*.
Returns
-------
mod : module
"""
...
os_fspath = ...
os_PathLike = os.PathLike

View file

@ -0,0 +1,56 @@
"""
This type stub file was generated by pyright.
"""
import pytest
"""
Pytest configuration and fixtures for the Numpy test suite.
"""
_old_fpu_mode = ...
_collect_results = ...
_pytest_ini = ...
def pytest_configure(config): # -> None:
...
def pytest_addoption(parser): # -> None:
...
def pytest_sessionstart(session): # -> None:
...
@pytest.hookimpl()
def pytest_itemcollected(item): # -> None:
"""
Check FPU precision mode was not changed during test collection.
The clumsy way we do it here is mainly necessary because numpy
still uses yield tests, which can execute code at test collection
time.
"""
...
@pytest.fixture(scope="function", autouse=True)
def check_fpu_mode(request): # -> Generator[None, Any, None]:
"""
Check FPU precision mode was not changed during the test.
"""
...
@pytest.fixture(autouse=True)
def add_np(doctest_namespace): # -> None:
...
@pytest.fixture(autouse=True)
def env_setup(monkeypatch): # -> None:
...
@pytest.fixture(params=[True, False])
def weak_promotion(request): # -> Generator[Unknown, Any, None]:
"""
Fixture to ensure "legacy" promotion state or change it to use the new
weak promotion (plus warning). `old_promotion` should be used as a
parameter in the function.
"""
...

View file

@ -0,0 +1,4 @@
"""
This type stub file was generated by pyright.
"""

View file

@ -0,0 +1,25 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Iterable
from typing import Any, Literal, TypeVar, Union, overload
from numpy import ndarray
from numpy._typing import DTypeLike, _SupportsArrayFunc
_ArrayType = TypeVar("_ArrayType", bound=ndarray[Any, Any])
_Requirements = Literal["C", "C_CONTIGUOUS", "CONTIGUOUS", "F", "F_CONTIGUOUS", "FORTRAN", "A", "ALIGNED", "W", "WRITEABLE", "O", "OWNDATA"]
_E = Literal["E", "ENSUREARRAY"]
_RequirementsWithE = Union[_Requirements, _E]
@overload
def require(a: _ArrayType, dtype: None = ..., requirements: None | _Requirements | Iterable[_Requirements] = ..., *, like: _SupportsArrayFunc = ...) -> _ArrayType:
...
@overload
def require(a: object, dtype: DTypeLike = ..., requirements: _E | Iterable[_RequirementsWithE] = ..., *, like: _SupportsArrayFunc = ...) -> ndarray[Any, Any]:
...
@overload
def require(a: object, dtype: DTypeLike = ..., requirements: None | _Requirements | Iterable[_Requirements] = ..., *, like: _SupportsArrayFunc = ...) -> ndarray[Any, Any]:
...

View file

@ -0,0 +1,44 @@
"""
This type stub file was generated by pyright.
"""
import ctypes as ct
from typing import Any, Generic, TypeVar, overload
from numpy import ndarray
from numpy.ctypeslib import c_intp
_CastT = TypeVar("_CastT", bound=ct._CanCastTo)
_CT = TypeVar("_CT", bound=ct._CData)
_PT = TypeVar("_PT", bound=None | int)
class _ctypes(Generic[_PT]):
@overload
def __new__(cls, array: ndarray[Any, Any], ptr: None = ...) -> _ctypes[None]:
...
@overload
def __new__(cls, array: ndarray[Any, Any], ptr: _PT) -> _ctypes[_PT]:
...
@property
def data(self) -> _PT:
...
@property
def shape(self) -> ct.Array[c_intp]:
...
@property
def strides(self) -> ct.Array[c_intp]:
...
def data_as(self, obj: type[_CastT]) -> _CastT:
...
def shape_as(self, obj: type[_CT]) -> ct.Array[_CT]:
...
def strides_as(self, obj: type[_CT]) -> ct.Array[_CT]:
...

View file

@ -0,0 +1,18 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, TypedDict
from numpy import complexfloating, floating, generic, signedinteger, unsignedinteger
class _SCTypes(TypedDict):
int: list[type[signedinteger[Any]]]
uint: list[type[unsignedinteger[Any]]]
float: list[type[floating[Any]]]
complex: list[type[complexfloating[Any, Any]]]
others: list[type]
...
sctypeDict: dict[int | str, type[generic]]
sctypes: _SCTypes

View file

@ -0,0 +1,45 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Callable
from typing import Any, Literal, TypedDict
from numpy import _SupportsWrite
_ErrKind = Literal["ignore", "warn", "raise", "call", "print", "log"]
_ErrFunc = Callable[[str, int], Any]
class _ErrDict(TypedDict):
divide: _ErrKind
over: _ErrKind
under: _ErrKind
invalid: _ErrKind
...
class _ErrDictOptional(TypedDict, total=False):
all: None | _ErrKind
divide: None | _ErrKind
over: None | _ErrKind
under: None | _ErrKind
invalid: None | _ErrKind
...
def seterr(all: None | _ErrKind = ..., divide: None | _ErrKind = ..., over: None | _ErrKind = ..., under: None | _ErrKind = ..., invalid: None | _ErrKind = ...) -> _ErrDict:
...
def geterr() -> _ErrDict:
...
def setbufsize(size: int) -> int:
...
def getbufsize() -> int:
...
def seterrcall(func: None | _ErrFunc | _SupportsWrite[str]) -> None | _ErrFunc | _SupportsWrite[str]:
...
def geterrcall() -> None | _ErrFunc | _SupportsWrite[str]:
...

View file

@ -0,0 +1,73 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Callable
from typing import Any, Literal, SupportsIndex, TypedDict
from contextlib import _GeneratorContextManager
from numpy import bool_, clongdouble, complexfloating, datetime64, floating, integer, longdouble, ndarray, timedelta64, void
from numpy._typing import _CharLike_co, _FloatLike_co
_FloatMode = Literal["fixed", "unique", "maxprec", "maxprec_equal"]
class _FormatDict(TypedDict, total=False):
bool: Callable[[bool_], str]
int: Callable[[integer[Any]], str]
timedelta: Callable[[timedelta64], str]
datetime: Callable[[datetime64], str]
float: Callable[[floating[Any]], str]
longfloat: Callable[[longdouble], str]
complexfloat: Callable[[complexfloating[Any, Any]], str]
longcomplexfloat: Callable[[clongdouble], str]
void: Callable[[void], str]
numpystr: Callable[[_CharLike_co], str]
object: Callable[[object], str]
all: Callable[[object], str]
int_kind: Callable[[integer[Any]], str]
float_kind: Callable[[floating[Any]], str]
complex_kind: Callable[[complexfloating[Any, Any]], str]
str_kind: Callable[[_CharLike_co], str]
...
class _FormatOptions(TypedDict):
precision: int
threshold: int
edgeitems: int
linewidth: int
suppress: bool
nanstr: str
infstr: str
formatter: None | _FormatDict
sign: Literal["-", "+", " "]
floatmode: _FloatMode
legacy: Literal[False, "1.13", "1.21"]
...
def set_printoptions(precision: None | SupportsIndex = ..., threshold: None | int = ..., edgeitems: None | int = ..., linewidth: None | int = ..., suppress: None | bool = ..., nanstr: None | str = ..., infstr: None | str = ..., formatter: None | _FormatDict = ..., sign: Literal[None, "-", "+", " "] = ..., floatmode: None | _FloatMode = ..., *, legacy: Literal[None, False, "1.13", "1.21"] = ...) -> None:
...
def get_printoptions() -> _FormatOptions:
...
def array2string(a: ndarray[Any, Any], max_line_width: None | int = ..., precision: None | SupportsIndex = ..., suppress_small: None | bool = ..., separator: str = ..., prefix: str = ..., *, formatter: None | _FormatDict = ..., threshold: None | int = ..., edgeitems: None | int = ..., sign: Literal[None, "-", "+", " "] = ..., floatmode: None | _FloatMode = ..., suffix: str = ..., legacy: Literal[None, False, "1.13", "1.21"] = ...) -> str:
...
def format_float_scientific(x: _FloatLike_co, precision: None | int = ..., unique: bool = ..., trim: Literal["k", ".", "0", "-"] = ..., sign: bool = ..., pad_left: None | int = ..., exp_digits: None | int = ..., min_digits: None | int = ...) -> str:
...
def format_float_positional(x: _FloatLike_co, precision: None | int = ..., unique: bool = ..., fractional: bool = ..., trim: Literal["k", ".", "0", "-"] = ..., sign: bool = ..., pad_left: None | int = ..., pad_right: None | int = ..., min_digits: None | int = ...) -> str:
...
def array_repr(arr: ndarray[Any, Any], max_line_width: None | int = ..., precision: None | SupportsIndex = ..., suppress_small: None | bool = ...) -> str:
...
def array_str(a: ndarray[Any, Any], max_line_width: None | int = ..., precision: None | SupportsIndex = ..., suppress_small: None | bool = ...) -> str:
...
def set_string_function(f: None | Callable[[ndarray[Any, Any]], str], repr: bool = ...) -> None:
...
def printoptions(precision: None | SupportsIndex = ..., threshold: None | int = ..., edgeitems: None | int = ..., linewidth: None | int = ..., suppress: None | bool = ..., nanstr: None | str = ..., infstr: None | str = ..., formatter: None | _FormatDict = ..., sign: Literal[None, "-", "+", " "] = ..., floatmode: None | _FloatMode = ..., *, legacy: Literal[None, False, "1.13", "1.21"] = ...) -> _GeneratorContextManager[_FormatOptions]:
...

View file

@ -0,0 +1,375 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, Literal as L, TypeVar, overload
from numpy import _OrderKACF, bool_, bytes_, chararray as chararray, dtype, int_, object_, str_
from numpy._typing import NDArray, _ArrayLikeBool_co as b_co, _ArrayLikeBytes_co as S_co, _ArrayLikeInt_co as i_co, _ArrayLikeStr_co as U_co
_SCT = TypeVar("_SCT", str_, bytes_)
_CharArray = chararray[Any, dtype[_SCT]]
__all__: list[str]
@overload
def equal(x1: U_co, x2: U_co) -> NDArray[bool_]:
...
@overload
def equal(x1: S_co, x2: S_co) -> NDArray[bool_]:
...
@overload
def not_equal(x1: U_co, x2: U_co) -> NDArray[bool_]:
...
@overload
def not_equal(x1: S_co, x2: S_co) -> NDArray[bool_]:
...
@overload
def greater_equal(x1: U_co, x2: U_co) -> NDArray[bool_]:
...
@overload
def greater_equal(x1: S_co, x2: S_co) -> NDArray[bool_]:
...
@overload
def less_equal(x1: U_co, x2: U_co) -> NDArray[bool_]:
...
@overload
def less_equal(x1: S_co, x2: S_co) -> NDArray[bool_]:
...
@overload
def greater(x1: U_co, x2: U_co) -> NDArray[bool_]:
...
@overload
def greater(x1: S_co, x2: S_co) -> NDArray[bool_]:
...
@overload
def less(x1: U_co, x2: U_co) -> NDArray[bool_]:
...
@overload
def less(x1: S_co, x2: S_co) -> NDArray[bool_]:
...
@overload
def add(x1: U_co, x2: U_co) -> NDArray[str_]:
...
@overload
def add(x1: S_co, x2: S_co) -> NDArray[bytes_]:
...
@overload
def multiply(a: U_co, i: i_co) -> NDArray[str_]:
...
@overload
def multiply(a: S_co, i: i_co) -> NDArray[bytes_]:
...
@overload
def mod(a: U_co, value: Any) -> NDArray[str_]:
...
@overload
def mod(a: S_co, value: Any) -> NDArray[bytes_]:
...
@overload
def capitalize(a: U_co) -> NDArray[str_]:
...
@overload
def capitalize(a: S_co) -> NDArray[bytes_]:
...
@overload
def center(a: U_co, width: i_co, fillchar: U_co = ...) -> NDArray[str_]:
...
@overload
def center(a: S_co, width: i_co, fillchar: S_co = ...) -> NDArray[bytes_]:
...
def decode(a: S_co, encoding: None | str = ..., errors: None | str = ...) -> NDArray[str_]:
...
def encode(a: U_co, encoding: None | str = ..., errors: None | str = ...) -> NDArray[bytes_]:
...
@overload
def expandtabs(a: U_co, tabsize: i_co = ...) -> NDArray[str_]:
...
@overload
def expandtabs(a: S_co, tabsize: i_co = ...) -> NDArray[bytes_]:
...
@overload
def join(sep: U_co, seq: U_co) -> NDArray[str_]:
...
@overload
def join(sep: S_co, seq: S_co) -> NDArray[bytes_]:
...
@overload
def ljust(a: U_co, width: i_co, fillchar: U_co = ...) -> NDArray[str_]:
...
@overload
def ljust(a: S_co, width: i_co, fillchar: S_co = ...) -> NDArray[bytes_]:
...
@overload
def lower(a: U_co) -> NDArray[str_]:
...
@overload
def lower(a: S_co) -> NDArray[bytes_]:
...
@overload
def lstrip(a: U_co, chars: None | U_co = ...) -> NDArray[str_]:
...
@overload
def lstrip(a: S_co, chars: None | S_co = ...) -> NDArray[bytes_]:
...
@overload
def partition(a: U_co, sep: U_co) -> NDArray[str_]:
...
@overload
def partition(a: S_co, sep: S_co) -> NDArray[bytes_]:
...
@overload
def replace(a: U_co, old: U_co, new: U_co, count: None | i_co = ...) -> NDArray[str_]:
...
@overload
def replace(a: S_co, old: S_co, new: S_co, count: None | i_co = ...) -> NDArray[bytes_]:
...
@overload
def rjust(a: U_co, width: i_co, fillchar: U_co = ...) -> NDArray[str_]:
...
@overload
def rjust(a: S_co, width: i_co, fillchar: S_co = ...) -> NDArray[bytes_]:
...
@overload
def rpartition(a: U_co, sep: U_co) -> NDArray[str_]:
...
@overload
def rpartition(a: S_co, sep: S_co) -> NDArray[bytes_]:
...
@overload
def rsplit(a: U_co, sep: None | U_co = ..., maxsplit: None | i_co = ...) -> NDArray[object_]:
...
@overload
def rsplit(a: S_co, sep: None | S_co = ..., maxsplit: None | i_co = ...) -> NDArray[object_]:
...
@overload
def rstrip(a: U_co, chars: None | U_co = ...) -> NDArray[str_]:
...
@overload
def rstrip(a: S_co, chars: None | S_co = ...) -> NDArray[bytes_]:
...
@overload
def split(a: U_co, sep: None | U_co = ..., maxsplit: None | i_co = ...) -> NDArray[object_]:
...
@overload
def split(a: S_co, sep: None | S_co = ..., maxsplit: None | i_co = ...) -> NDArray[object_]:
...
@overload
def splitlines(a: U_co, keepends: None | b_co = ...) -> NDArray[object_]:
...
@overload
def splitlines(a: S_co, keepends: None | b_co = ...) -> NDArray[object_]:
...
@overload
def strip(a: U_co, chars: None | U_co = ...) -> NDArray[str_]:
...
@overload
def strip(a: S_co, chars: None | S_co = ...) -> NDArray[bytes_]:
...
@overload
def swapcase(a: U_co) -> NDArray[str_]:
...
@overload
def swapcase(a: S_co) -> NDArray[bytes_]:
...
@overload
def title(a: U_co) -> NDArray[str_]:
...
@overload
def title(a: S_co) -> NDArray[bytes_]:
...
@overload
def translate(a: U_co, table: U_co, deletechars: None | U_co = ...) -> NDArray[str_]:
...
@overload
def translate(a: S_co, table: S_co, deletechars: None | S_co = ...) -> NDArray[bytes_]:
...
@overload
def upper(a: U_co) -> NDArray[str_]:
...
@overload
def upper(a: S_co) -> NDArray[bytes_]:
...
@overload
def zfill(a: U_co, width: i_co) -> NDArray[str_]:
...
@overload
def zfill(a: S_co, width: i_co) -> NDArray[bytes_]:
...
@overload
def count(a: U_co, sub: U_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[int_]:
...
@overload
def count(a: S_co, sub: S_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[int_]:
...
@overload
def endswith(a: U_co, suffix: U_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[bool_]:
...
@overload
def endswith(a: S_co, suffix: S_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[bool_]:
...
@overload
def find(a: U_co, sub: U_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[int_]:
...
@overload
def find(a: S_co, sub: S_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[int_]:
...
@overload
def index(a: U_co, sub: U_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[int_]:
...
@overload
def index(a: S_co, sub: S_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[int_]:
...
def isalpha(a: U_co | S_co) -> NDArray[bool_]:
...
def isalnum(a: U_co | S_co) -> NDArray[bool_]:
...
def isdecimal(a: U_co | S_co) -> NDArray[bool_]:
...
def isdigit(a: U_co | S_co) -> NDArray[bool_]:
...
def islower(a: U_co | S_co) -> NDArray[bool_]:
...
def isnumeric(a: U_co | S_co) -> NDArray[bool_]:
...
def isspace(a: U_co | S_co) -> NDArray[bool_]:
...
def istitle(a: U_co | S_co) -> NDArray[bool_]:
...
def isupper(a: U_co | S_co) -> NDArray[bool_]:
...
@overload
def rfind(a: U_co, sub: U_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[int_]:
...
@overload
def rfind(a: S_co, sub: S_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[int_]:
...
@overload
def rindex(a: U_co, sub: U_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[int_]:
...
@overload
def rindex(a: S_co, sub: S_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[int_]:
...
@overload
def startswith(a: U_co, prefix: U_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[bool_]:
...
@overload
def startswith(a: S_co, prefix: S_co, start: i_co = ..., end: None | i_co = ...) -> NDArray[bool_]:
...
def str_len(A: U_co | S_co) -> NDArray[int_]:
...
@overload
def array(obj: U_co, itemsize: None | int = ..., copy: bool = ..., unicode: L[False] = ..., order: _OrderKACF = ...) -> _CharArray[str_]:
...
@overload
def array(obj: S_co, itemsize: None | int = ..., copy: bool = ..., unicode: L[False] = ..., order: _OrderKACF = ...) -> _CharArray[bytes_]:
...
@overload
def array(obj: object, itemsize: None | int = ..., copy: bool = ..., unicode: L[False] = ..., order: _OrderKACF = ...) -> _CharArray[bytes_]:
...
@overload
def array(obj: object, itemsize: None | int = ..., copy: bool = ..., unicode: L[True] = ..., order: _OrderKACF = ...) -> _CharArray[str_]:
...
@overload
def asarray(obj: U_co, itemsize: None | int = ..., unicode: L[False] = ..., order: _OrderKACF = ...) -> _CharArray[str_]:
...
@overload
def asarray(obj: S_co, itemsize: None | int = ..., unicode: L[False] = ..., order: _OrderKACF = ...) -> _CharArray[bytes_]:
...
@overload
def asarray(obj: object, itemsize: None | int = ..., unicode: L[False] = ..., order: _OrderKACF = ...) -> _CharArray[bytes_]:
...
@overload
def asarray(obj: object, itemsize: None | int = ..., unicode: L[True] = ..., order: _OrderKACF = ...) -> _CharArray[str_]:
...

View file

@ -0,0 +1,65 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Sequence
from typing import Any, Literal, TypeVar, Union, overload
from numpy import _OrderKACF, bool_, dtype, ndarray, number
from numpy._typing import _ArrayLikeBool_co, _ArrayLikeComplex_co, _ArrayLikeFloat_co, _ArrayLikeInt_co, _ArrayLikeObject_co, _ArrayLikeUInt_co, _DTypeLikeBool, _DTypeLikeComplex, _DTypeLikeComplex_co, _DTypeLikeFloat, _DTypeLikeInt, _DTypeLikeObject, _DTypeLikeUInt
_ArrayType = TypeVar("_ArrayType", bound=ndarray[Any, dtype[Union[bool_, number[Any]]]])
_OptimizeKind = None | bool | Literal["greedy", "optimal"] | Sequence[Any]
_CastingSafe = Literal["no", "equiv", "safe", "same_kind"]
_CastingUnsafe = Literal["unsafe"]
__all__: list[str]
@overload
def einsum(subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeBool_co, out: None = ..., dtype: None | _DTypeLikeBool = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ...) -> Any:
...
@overload
def einsum(subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeUInt_co, out: None = ..., dtype: None | _DTypeLikeUInt = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ...) -> Any:
...
@overload
def einsum(subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeInt_co, out: None = ..., dtype: None | _DTypeLikeInt = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ...) -> Any:
...
@overload
def einsum(subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeFloat_co, out: None = ..., dtype: None | _DTypeLikeFloat = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ...) -> Any:
...
@overload
def einsum(subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeComplex_co, out: None = ..., dtype: None | _DTypeLikeComplex = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ...) -> Any:
...
@overload
def einsum(subscripts: str | _ArrayLikeInt_co, /, *operands: Any, casting: _CastingUnsafe, dtype: None | _DTypeLikeComplex_co = ..., out: None = ..., order: _OrderKACF = ..., optimize: _OptimizeKind = ...) -> Any:
...
@overload
def einsum(subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeComplex_co, out: _ArrayType, dtype: None | _DTypeLikeComplex_co = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ...) -> _ArrayType:
...
@overload
def einsum(subscripts: str | _ArrayLikeInt_co, /, *operands: Any, out: _ArrayType, casting: _CastingUnsafe, dtype: None | _DTypeLikeComplex_co = ..., order: _OrderKACF = ..., optimize: _OptimizeKind = ...) -> _ArrayType:
...
@overload
def einsum(subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeObject_co, out: None = ..., dtype: None | _DTypeLikeObject = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ...) -> Any:
...
@overload
def einsum(subscripts: str | _ArrayLikeInt_co, /, *operands: Any, casting: _CastingUnsafe, dtype: None | _DTypeLikeObject = ..., out: None = ..., order: _OrderKACF = ..., optimize: _OptimizeKind = ...) -> Any:
...
@overload
def einsum(subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeObject_co, out: _ArrayType, dtype: None | _DTypeLikeObject = ..., order: _OrderKACF = ..., casting: _CastingSafe = ..., optimize: _OptimizeKind = ...) -> _ArrayType:
...
@overload
def einsum(subscripts: str | _ArrayLikeInt_co, /, *operands: Any, out: _ArrayType, casting: _CastingUnsafe, dtype: None | _DTypeLikeObject = ..., order: _OrderKACF = ..., optimize: _OptimizeKind = ...) -> _ArrayType:
...
def einsum_path(subscripts: str | _ArrayLikeInt_co, /, *operands: _ArrayLikeComplex_co | _DTypeLikeObject, optimize: _OptimizeKind = ...) -> tuple[list[Any], str]:
...

View file

@ -0,0 +1,489 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Sequence
from typing import Any, Literal, SupportsIndex, TypeVar, overload
from numpy import _CastingKind, _ModeKind, _OrderACF, _OrderKACF, _PartitionKind, _SortKind, _SortSide, bool_, complexfloating, float16, floating, generic, int64, int_, intp, number, object_, uint64
from numpy._typing import ArrayLike, DTypeLike, NDArray, _ArrayLike, _ArrayLikeBool_co, _ArrayLikeComplex_co, _ArrayLikeFloat_co, _ArrayLikeInt_co, _ArrayLikeObject_co, _ArrayLikeUInt_co, _BoolLike_co, _ComplexLike_co, _DTypeLike, _IntLike_co, _NumberLike_co, _ScalarLike_co, _Shape, _ShapeLike
_SCT = TypeVar("_SCT", bound=generic)
_SCT_uifcO = TypeVar("_SCT_uifcO", bound=number[Any] | object_)
_ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
__all__: list[str]
@overload
def take(a: _ArrayLike[_SCT], indices: _IntLike_co, axis: None = ..., out: None = ..., mode: _ModeKind = ...) -> _SCT:
...
@overload
def take(a: ArrayLike, indices: _IntLike_co, axis: None | SupportsIndex = ..., out: None = ..., mode: _ModeKind = ...) -> Any:
...
@overload
def take(a: _ArrayLike[_SCT], indices: _ArrayLikeInt_co, axis: None | SupportsIndex = ..., out: None = ..., mode: _ModeKind = ...) -> NDArray[_SCT]:
...
@overload
def take(a: ArrayLike, indices: _ArrayLikeInt_co, axis: None | SupportsIndex = ..., out: None = ..., mode: _ModeKind = ...) -> NDArray[Any]:
...
@overload
def take(a: ArrayLike, indices: _ArrayLikeInt_co, axis: None | SupportsIndex = ..., out: _ArrayType = ..., mode: _ModeKind = ...) -> _ArrayType:
...
@overload
def reshape(a: _ArrayLike[_SCT], newshape: _ShapeLike, order: _OrderACF = ...) -> NDArray[_SCT]:
...
@overload
def reshape(a: ArrayLike, newshape: _ShapeLike, order: _OrderACF = ...) -> NDArray[Any]:
...
@overload
def choose(a: _IntLike_co, choices: ArrayLike, out: None = ..., mode: _ModeKind = ...) -> Any:
...
@overload
def choose(a: _ArrayLikeInt_co, choices: _ArrayLike[_SCT], out: None = ..., mode: _ModeKind = ...) -> NDArray[_SCT]:
...
@overload
def choose(a: _ArrayLikeInt_co, choices: ArrayLike, out: None = ..., mode: _ModeKind = ...) -> NDArray[Any]:
...
@overload
def choose(a: _ArrayLikeInt_co, choices: ArrayLike, out: _ArrayType = ..., mode: _ModeKind = ...) -> _ArrayType:
...
@overload
def repeat(a: _ArrayLike[_SCT], repeats: _ArrayLikeInt_co, axis: None | SupportsIndex = ...) -> NDArray[_SCT]:
...
@overload
def repeat(a: ArrayLike, repeats: _ArrayLikeInt_co, axis: None | SupportsIndex = ...) -> NDArray[Any]:
...
def put(a: NDArray[Any], ind: _ArrayLikeInt_co, v: ArrayLike, mode: _ModeKind = ...) -> None:
...
@overload
def swapaxes(a: _ArrayLike[_SCT], axis1: SupportsIndex, axis2: SupportsIndex) -> NDArray[_SCT]:
...
@overload
def swapaxes(a: ArrayLike, axis1: SupportsIndex, axis2: SupportsIndex) -> NDArray[Any]:
...
@overload
def transpose(a: _ArrayLike[_SCT], axes: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def transpose(a: ArrayLike, axes: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def partition(a: _ArrayLike[_SCT], kth: _ArrayLikeInt_co, axis: None | SupportsIndex = ..., kind: _PartitionKind = ..., order: None | str | Sequence[str] = ...) -> NDArray[_SCT]:
...
@overload
def partition(a: ArrayLike, kth: _ArrayLikeInt_co, axis: None | SupportsIndex = ..., kind: _PartitionKind = ..., order: None | str | Sequence[str] = ...) -> NDArray[Any]:
...
def argpartition(a: ArrayLike, kth: _ArrayLikeInt_co, axis: None | SupportsIndex = ..., kind: _PartitionKind = ..., order: None | str | Sequence[str] = ...) -> NDArray[intp]:
...
@overload
def sort(a: _ArrayLike[_SCT], axis: None | SupportsIndex = ..., kind: None | _SortKind = ..., order: None | str | Sequence[str] = ...) -> NDArray[_SCT]:
...
@overload
def sort(a: ArrayLike, axis: None | SupportsIndex = ..., kind: None | _SortKind = ..., order: None | str | Sequence[str] = ...) -> NDArray[Any]:
...
def argsort(a: ArrayLike, axis: None | SupportsIndex = ..., kind: None | _SortKind = ..., order: None | str | Sequence[str] = ...) -> NDArray[intp]:
...
@overload
def argmax(a: ArrayLike, axis: None = ..., out: None = ..., *, keepdims: Literal[False] = ...) -> intp:
...
@overload
def argmax(a: ArrayLike, axis: None | SupportsIndex = ..., out: None = ..., *, keepdims: bool = ...) -> Any:
...
@overload
def argmax(a: ArrayLike, axis: None | SupportsIndex = ..., out: _ArrayType = ..., *, keepdims: bool = ...) -> _ArrayType:
...
@overload
def argmin(a: ArrayLike, axis: None = ..., out: None = ..., *, keepdims: Literal[False] = ...) -> intp:
...
@overload
def argmin(a: ArrayLike, axis: None | SupportsIndex = ..., out: None = ..., *, keepdims: bool = ...) -> Any:
...
@overload
def argmin(a: ArrayLike, axis: None | SupportsIndex = ..., out: _ArrayType = ..., *, keepdims: bool = ...) -> _ArrayType:
...
@overload
def searchsorted(a: ArrayLike, v: _ScalarLike_co, side: _SortSide = ..., sorter: None | _ArrayLikeInt_co = ...) -> intp:
...
@overload
def searchsorted(a: ArrayLike, v: ArrayLike, side: _SortSide = ..., sorter: None | _ArrayLikeInt_co = ...) -> NDArray[intp]:
...
@overload
def resize(a: _ArrayLike[_SCT], new_shape: _ShapeLike) -> NDArray[_SCT]:
...
@overload
def resize(a: ArrayLike, new_shape: _ShapeLike) -> NDArray[Any]:
...
@overload
def squeeze(a: _SCT, axis: None | _ShapeLike = ...) -> _SCT:
...
@overload
def squeeze(a: _ArrayLike[_SCT], axis: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def squeeze(a: ArrayLike, axis: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def diagonal(a: _ArrayLike[_SCT], offset: SupportsIndex = ..., axis1: SupportsIndex = ..., axis2: SupportsIndex = ...) -> NDArray[_SCT]:
...
@overload
def diagonal(a: ArrayLike, offset: SupportsIndex = ..., axis1: SupportsIndex = ..., axis2: SupportsIndex = ...) -> NDArray[Any]:
...
@overload
def trace(a: ArrayLike, offset: SupportsIndex = ..., axis1: SupportsIndex = ..., axis2: SupportsIndex = ..., dtype: DTypeLike = ..., out: None = ...) -> Any:
...
@overload
def trace(a: ArrayLike, offset: SupportsIndex = ..., axis1: SupportsIndex = ..., axis2: SupportsIndex = ..., dtype: DTypeLike = ..., out: _ArrayType = ...) -> _ArrayType:
...
@overload
def ravel(a: _ArrayLike[_SCT], order: _OrderKACF = ...) -> NDArray[_SCT]:
...
@overload
def ravel(a: ArrayLike, order: _OrderKACF = ...) -> NDArray[Any]:
...
def nonzero(a: ArrayLike) -> tuple[NDArray[intp], ...]:
...
def shape(a: ArrayLike) -> _Shape:
...
@overload
def compress(condition: _ArrayLikeBool_co, a: _ArrayLike[_SCT], axis: None | SupportsIndex = ..., out: None = ...) -> NDArray[_SCT]:
...
@overload
def compress(condition: _ArrayLikeBool_co, a: ArrayLike, axis: None | SupportsIndex = ..., out: None = ...) -> NDArray[Any]:
...
@overload
def compress(condition: _ArrayLikeBool_co, a: ArrayLike, axis: None | SupportsIndex = ..., out: _ArrayType = ...) -> _ArrayType:
...
@overload
def clip(a: _SCT, a_min: None | ArrayLike, a_max: None | ArrayLike, out: None = ..., *, dtype: None = ..., where: None | _ArrayLikeBool_co = ..., order: _OrderKACF = ..., subok: bool = ..., signature: str | tuple[None | str, ...] = ..., extobj: list[Any] = ..., casting: _CastingKind = ...) -> _SCT:
...
@overload
def clip(a: _ScalarLike_co, a_min: None | ArrayLike, a_max: None | ArrayLike, out: None = ..., *, dtype: None = ..., where: None | _ArrayLikeBool_co = ..., order: _OrderKACF = ..., subok: bool = ..., signature: str | tuple[None | str, ...] = ..., extobj: list[Any] = ..., casting: _CastingKind = ...) -> Any:
...
@overload
def clip(a: _ArrayLike[_SCT], a_min: None | ArrayLike, a_max: None | ArrayLike, out: None = ..., *, dtype: None = ..., where: None | _ArrayLikeBool_co = ..., order: _OrderKACF = ..., subok: bool = ..., signature: str | tuple[None | str, ...] = ..., extobj: list[Any] = ..., casting: _CastingKind = ...) -> NDArray[_SCT]:
...
@overload
def clip(a: ArrayLike, a_min: None | ArrayLike, a_max: None | ArrayLike, out: None = ..., *, dtype: None = ..., where: None | _ArrayLikeBool_co = ..., order: _OrderKACF = ..., subok: bool = ..., signature: str | tuple[None | str, ...] = ..., extobj: list[Any] = ..., casting: _CastingKind = ...) -> NDArray[Any]:
...
@overload
def clip(a: ArrayLike, a_min: None | ArrayLike, a_max: None | ArrayLike, out: _ArrayType = ..., *, dtype: DTypeLike, where: None | _ArrayLikeBool_co = ..., order: _OrderKACF = ..., subok: bool = ..., signature: str | tuple[None | str, ...] = ..., extobj: list[Any] = ..., casting: _CastingKind = ...) -> Any:
...
@overload
def clip(a: ArrayLike, a_min: None | ArrayLike, a_max: None | ArrayLike, out: _ArrayType, *, dtype: DTypeLike = ..., where: None | _ArrayLikeBool_co = ..., order: _OrderKACF = ..., subok: bool = ..., signature: str | tuple[None | str, ...] = ..., extobj: list[Any] = ..., casting: _CastingKind = ...) -> _ArrayType:
...
@overload
def sum(a: _ArrayLike[_SCT], axis: None = ..., dtype: None = ..., out: None = ..., keepdims: bool = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> _SCT:
...
@overload
def sum(a: ArrayLike, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: None = ..., keepdims: bool = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def sum(a: ArrayLike, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: _ArrayType = ..., keepdims: bool = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> _ArrayType:
...
@overload
def all(a: ArrayLike, axis: None = ..., out: None = ..., keepdims: Literal[False] = ..., *, where: _ArrayLikeBool_co = ...) -> bool_:
...
@overload
def all(a: ArrayLike, axis: None | _ShapeLike = ..., out: None = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def all(a: ArrayLike, axis: None | _ShapeLike = ..., out: _ArrayType = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> _ArrayType:
...
@overload
def any(a: ArrayLike, axis: None = ..., out: None = ..., keepdims: Literal[False] = ..., *, where: _ArrayLikeBool_co = ...) -> bool_:
...
@overload
def any(a: ArrayLike, axis: None | _ShapeLike = ..., out: None = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def any(a: ArrayLike, axis: None | _ShapeLike = ..., out: _ArrayType = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> _ArrayType:
...
@overload
def cumsum(a: _ArrayLike[_SCT], axis: None | SupportsIndex = ..., dtype: None = ..., out: None = ...) -> NDArray[_SCT]:
...
@overload
def cumsum(a: ArrayLike, axis: None | SupportsIndex = ..., dtype: None = ..., out: None = ...) -> NDArray[Any]:
...
@overload
def cumsum(a: ArrayLike, axis: None | SupportsIndex = ..., dtype: _DTypeLike[_SCT] = ..., out: None = ...) -> NDArray[_SCT]:
...
@overload
def cumsum(a: ArrayLike, axis: None | SupportsIndex = ..., dtype: DTypeLike = ..., out: None = ...) -> NDArray[Any]:
...
@overload
def cumsum(a: ArrayLike, axis: None | SupportsIndex = ..., dtype: DTypeLike = ..., out: _ArrayType = ...) -> _ArrayType:
...
@overload
def ptp(a: _ArrayLike[_SCT], axis: None = ..., out: None = ..., keepdims: Literal[False] = ...) -> _SCT:
...
@overload
def ptp(a: ArrayLike, axis: None | _ShapeLike = ..., out: None = ..., keepdims: bool = ...) -> Any:
...
@overload
def ptp(a: ArrayLike, axis: None | _ShapeLike = ..., out: _ArrayType = ..., keepdims: bool = ...) -> _ArrayType:
...
@overload
def amax(a: _ArrayLike[_SCT], axis: None = ..., out: None = ..., keepdims: Literal[False] = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> _SCT:
...
@overload
def amax(a: ArrayLike, axis: None | _ShapeLike = ..., out: None = ..., keepdims: bool = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def amax(a: ArrayLike, axis: None | _ShapeLike = ..., out: _ArrayType = ..., keepdims: bool = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> _ArrayType:
...
@overload
def amin(a: _ArrayLike[_SCT], axis: None = ..., out: None = ..., keepdims: Literal[False] = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> _SCT:
...
@overload
def amin(a: ArrayLike, axis: None | _ShapeLike = ..., out: None = ..., keepdims: bool = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def amin(a: ArrayLike, axis: None | _ShapeLike = ..., out: _ArrayType = ..., keepdims: bool = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> _ArrayType:
...
@overload
def prod(a: _ArrayLikeBool_co, axis: None = ..., dtype: None = ..., out: None = ..., keepdims: Literal[False] = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> int_:
...
@overload
def prod(a: _ArrayLikeUInt_co, axis: None = ..., dtype: None = ..., out: None = ..., keepdims: Literal[False] = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> uint64:
...
@overload
def prod(a: _ArrayLikeInt_co, axis: None = ..., dtype: None = ..., out: None = ..., keepdims: Literal[False] = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> int64:
...
@overload
def prod(a: _ArrayLikeFloat_co, axis: None = ..., dtype: None = ..., out: None = ..., keepdims: Literal[False] = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> floating[Any]:
...
@overload
def prod(a: _ArrayLikeComplex_co, axis: None = ..., dtype: None = ..., out: None = ..., keepdims: Literal[False] = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> complexfloating[Any, Any]:
...
@overload
def prod(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., dtype: None = ..., out: None = ..., keepdims: bool = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def prod(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None = ..., dtype: _DTypeLike[_SCT] = ..., out: None = ..., keepdims: Literal[False] = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> _SCT:
...
@overload
def prod(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., dtype: None | DTypeLike = ..., out: None = ..., keepdims: bool = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def prod(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., dtype: None | DTypeLike = ..., out: _ArrayType = ..., keepdims: bool = ..., initial: _NumberLike_co = ..., where: _ArrayLikeBool_co = ...) -> _ArrayType:
...
@overload
def cumprod(a: _ArrayLikeBool_co, axis: None | SupportsIndex = ..., dtype: None = ..., out: None = ...) -> NDArray[int_]:
...
@overload
def cumprod(a: _ArrayLikeUInt_co, axis: None | SupportsIndex = ..., dtype: None = ..., out: None = ...) -> NDArray[uint64]:
...
@overload
def cumprod(a: _ArrayLikeInt_co, axis: None | SupportsIndex = ..., dtype: None = ..., out: None = ...) -> NDArray[int64]:
...
@overload
def cumprod(a: _ArrayLikeFloat_co, axis: None | SupportsIndex = ..., dtype: None = ..., out: None = ...) -> NDArray[floating[Any]]:
...
@overload
def cumprod(a: _ArrayLikeComplex_co, axis: None | SupportsIndex = ..., dtype: None = ..., out: None = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def cumprod(a: _ArrayLikeObject_co, axis: None | SupportsIndex = ..., dtype: None = ..., out: None = ...) -> NDArray[object_]:
...
@overload
def cumprod(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | SupportsIndex = ..., dtype: _DTypeLike[_SCT] = ..., out: None = ...) -> NDArray[_SCT]:
...
@overload
def cumprod(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | SupportsIndex = ..., dtype: DTypeLike = ..., out: None = ...) -> NDArray[Any]:
...
@overload
def cumprod(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | SupportsIndex = ..., dtype: DTypeLike = ..., out: _ArrayType = ...) -> _ArrayType:
...
def ndim(a: ArrayLike) -> int:
...
def size(a: ArrayLike, axis: None | int = ...) -> int:
...
@overload
def around(a: _BoolLike_co, decimals: SupportsIndex = ..., out: None = ...) -> float16:
...
@overload
def around(a: _SCT_uifcO, decimals: SupportsIndex = ..., out: None = ...) -> _SCT_uifcO:
...
@overload
def around(a: _ComplexLike_co | object_, decimals: SupportsIndex = ..., out: None = ...) -> Any:
...
@overload
def around(a: _ArrayLikeBool_co, decimals: SupportsIndex = ..., out: None = ...) -> NDArray[float16]:
...
@overload
def around(a: _ArrayLike[_SCT_uifcO], decimals: SupportsIndex = ..., out: None = ...) -> NDArray[_SCT_uifcO]:
...
@overload
def around(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, decimals: SupportsIndex = ..., out: None = ...) -> NDArray[Any]:
...
@overload
def around(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, decimals: SupportsIndex = ..., out: _ArrayType = ...) -> _ArrayType:
...
@overload
def mean(a: _ArrayLikeFloat_co, axis: None = ..., dtype: None = ..., out: None = ..., keepdims: Literal[False] = ..., *, where: _ArrayLikeBool_co = ...) -> floating[Any]:
...
@overload
def mean(a: _ArrayLikeComplex_co, axis: None = ..., dtype: None = ..., out: None = ..., keepdims: Literal[False] = ..., *, where: _ArrayLikeBool_co = ...) -> complexfloating[Any, Any]:
...
@overload
def mean(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., dtype: None = ..., out: None = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def mean(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None = ..., dtype: _DTypeLike[_SCT] = ..., out: None = ..., keepdims: Literal[False] = ..., *, where: _ArrayLikeBool_co = ...) -> _SCT:
...
@overload
def mean(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: None = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def mean(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: _ArrayType = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> _ArrayType:
...
@overload
def std(a: _ArrayLikeComplex_co, axis: None = ..., dtype: None = ..., out: None = ..., ddof: float = ..., keepdims: Literal[False] = ..., *, where: _ArrayLikeBool_co = ...) -> floating[Any]:
...
@overload
def std(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., dtype: None = ..., out: None = ..., ddof: float = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def std(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None = ..., dtype: _DTypeLike[_SCT] = ..., out: None = ..., ddof: float = ..., keepdims: Literal[False] = ..., *, where: _ArrayLikeBool_co = ...) -> _SCT:
...
@overload
def std(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: None = ..., ddof: float = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def std(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: _ArrayType = ..., ddof: float = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> _ArrayType:
...
@overload
def var(a: _ArrayLikeComplex_co, axis: None = ..., dtype: None = ..., out: None = ..., ddof: float = ..., keepdims: Literal[False] = ..., *, where: _ArrayLikeBool_co = ...) -> floating[Any]:
...
@overload
def var(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., dtype: None = ..., out: None = ..., ddof: float = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def var(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None = ..., dtype: _DTypeLike[_SCT] = ..., out: None = ..., ddof: float = ..., keepdims: Literal[False] = ..., *, where: _ArrayLikeBool_co = ...) -> _SCT:
...
@overload
def var(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: None = ..., ddof: float = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> Any:
...
@overload
def var(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, axis: None | _ShapeLike = ..., dtype: DTypeLike = ..., out: _ArrayType = ..., ddof: float = ..., keepdims: bool = ..., *, where: _ArrayLikeBool_co = ...) -> _ArrayType:
...
max = ...
min = ...
round = ...

View file

@ -0,0 +1,77 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, Literal as L, SupportsIndex, TypeVar, overload
from numpy import complexfloating, floating, generic
from numpy._typing import DTypeLike, NDArray, _ArrayLikeComplex_co, _ArrayLikeFloat_co, _DTypeLike
_SCT = TypeVar("_SCT", bound=generic)
__all__: list[str]
@overload
def linspace(start: _ArrayLikeFloat_co, stop: _ArrayLikeFloat_co, num: SupportsIndex = ..., endpoint: bool = ..., retstep: L[False] = ..., dtype: None = ..., axis: SupportsIndex = ...) -> NDArray[floating[Any]]:
...
@overload
def linspace(start: _ArrayLikeComplex_co, stop: _ArrayLikeComplex_co, num: SupportsIndex = ..., endpoint: bool = ..., retstep: L[False] = ..., dtype: None = ..., axis: SupportsIndex = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def linspace(start: _ArrayLikeComplex_co, stop: _ArrayLikeComplex_co, num: SupportsIndex = ..., endpoint: bool = ..., retstep: L[False] = ..., dtype: _DTypeLike[_SCT] = ..., axis: SupportsIndex = ...) -> NDArray[_SCT]:
...
@overload
def linspace(start: _ArrayLikeComplex_co, stop: _ArrayLikeComplex_co, num: SupportsIndex = ..., endpoint: bool = ..., retstep: L[False] = ..., dtype: DTypeLike = ..., axis: SupportsIndex = ...) -> NDArray[Any]:
...
@overload
def linspace(start: _ArrayLikeFloat_co, stop: _ArrayLikeFloat_co, num: SupportsIndex = ..., endpoint: bool = ..., retstep: L[True] = ..., dtype: None = ..., axis: SupportsIndex = ...) -> tuple[NDArray[floating[Any]], floating[Any]]:
...
@overload
def linspace(start: _ArrayLikeComplex_co, stop: _ArrayLikeComplex_co, num: SupportsIndex = ..., endpoint: bool = ..., retstep: L[True] = ..., dtype: None = ..., axis: SupportsIndex = ...) -> tuple[NDArray[complexfloating[Any, Any]], complexfloating[Any, Any]]:
...
@overload
def linspace(start: _ArrayLikeComplex_co, stop: _ArrayLikeComplex_co, num: SupportsIndex = ..., endpoint: bool = ..., retstep: L[True] = ..., dtype: _DTypeLike[_SCT] = ..., axis: SupportsIndex = ...) -> tuple[NDArray[_SCT], _SCT]:
...
@overload
def linspace(start: _ArrayLikeComplex_co, stop: _ArrayLikeComplex_co, num: SupportsIndex = ..., endpoint: bool = ..., retstep: L[True] = ..., dtype: DTypeLike = ..., axis: SupportsIndex = ...) -> tuple[NDArray[Any], Any]:
...
@overload
def logspace(start: _ArrayLikeFloat_co, stop: _ArrayLikeFloat_co, num: SupportsIndex = ..., endpoint: bool = ..., base: _ArrayLikeFloat_co = ..., dtype: None = ..., axis: SupportsIndex = ...) -> NDArray[floating[Any]]:
...
@overload
def logspace(start: _ArrayLikeComplex_co, stop: _ArrayLikeComplex_co, num: SupportsIndex = ..., endpoint: bool = ..., base: _ArrayLikeComplex_co = ..., dtype: None = ..., axis: SupportsIndex = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def logspace(start: _ArrayLikeComplex_co, stop: _ArrayLikeComplex_co, num: SupportsIndex = ..., endpoint: bool = ..., base: _ArrayLikeComplex_co = ..., dtype: _DTypeLike[_SCT] = ..., axis: SupportsIndex = ...) -> NDArray[_SCT]:
...
@overload
def logspace(start: _ArrayLikeComplex_co, stop: _ArrayLikeComplex_co, num: SupportsIndex = ..., endpoint: bool = ..., base: _ArrayLikeComplex_co = ..., dtype: DTypeLike = ..., axis: SupportsIndex = ...) -> NDArray[Any]:
...
@overload
def geomspace(start: _ArrayLikeFloat_co, stop: _ArrayLikeFloat_co, num: SupportsIndex = ..., endpoint: bool = ..., dtype: None = ..., axis: SupportsIndex = ...) -> NDArray[floating[Any]]:
...
@overload
def geomspace(start: _ArrayLikeComplex_co, stop: _ArrayLikeComplex_co, num: SupportsIndex = ..., endpoint: bool = ..., dtype: None = ..., axis: SupportsIndex = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def geomspace(start: _ArrayLikeComplex_co, stop: _ArrayLikeComplex_co, num: SupportsIndex = ..., endpoint: bool = ..., dtype: _DTypeLike[_SCT] = ..., axis: SupportsIndex = ...) -> NDArray[_SCT]:
...
@overload
def geomspace(start: _ArrayLikeComplex_co, stop: _ArrayLikeComplex_co, num: SupportsIndex = ..., endpoint: bool = ..., dtype: DTypeLike = ..., axis: SupportsIndex = ...) -> NDArray[Any]:
...
def add_newdoc(place: str, obj: str, doc: str | tuple[str, str] | list[tuple[str, str]], warn_on_python: bool = ...) -> None:
...

View file

@ -0,0 +1,521 @@
"""
This type stub file was generated by pyright.
"""
import os
import datetime as dt
from collections.abc import Callable, Iterable, Sequence
from typing import Any, ClassVar, Final, Literal as L, Protocol, SupportsIndex, TypeVar, final, overload
from numpy import _CastingKind, _CopyMode, _IOProtocol, _ModeKind, _NDIterFlagsKind, _NDIterOpFlagsKind, _OrderCF, _OrderKACF, _SupportsBuffer, bool_, busdaycalendar as busdaycalendar, complexfloating, datetime64, dtype as dtype, float64, floating, generic, int_, intp, nditer as nditer, signedinteger, str_, timedelta64, ufunc, uint8, unsignedinteger
from numpy._typing import ArrayLike, DTypeLike, NDArray, _ArrayLike, _ArrayLikeBool_co, _ArrayLikeBytes_co, _ArrayLikeComplex_co, _ArrayLikeDT64_co, _ArrayLikeFloat_co, _ArrayLikeInt_co, _ArrayLikeObject_co, _ArrayLikeStr_co, _ArrayLikeTD64_co, _ArrayLikeUInt_co, _DTypeLike, _FloatLike_co, _IntLike_co, _NestedSequence, _ScalarLike_co, _ShapeLike, _SupportsArrayFunc, _TD64Like_co
_T_co = TypeVar("_T_co", covariant=True)
_T_contra = TypeVar("_T_contra", contravariant=True)
_SCT = TypeVar("_SCT", bound=generic)
_ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
_UnitKind = L["Y", "M", "D", "h", "m", "s", "ms", "us", "μs", "ns", "ps", "fs", "as",]
_RollKind = L["nat", "forward", "following", "backward", "preceding", "modifiedfollowing", "modifiedpreceding",]
class _SupportsLenAndGetItem(Protocol[_T_contra, _T_co]):
def __len__(self) -> int:
...
def __getitem__(self, key: _T_contra, /) -> _T_co:
...
__all__: list[str]
ALLOW_THREADS: Final[int]
BUFSIZE: L[8192]
CLIP: L[0]
WRAP: L[1]
RAISE: L[2]
MAXDIMS: L[32]
MAY_SHARE_BOUNDS: L[0]
MAY_SHARE_EXACT: L[-1]
tracemalloc_domain: L[389047]
@overload
def empty_like(prototype: _ArrayType, dtype: None = ..., order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> _ArrayType:
...
@overload
def empty_like(prototype: _ArrayLike[_SCT], dtype: None = ..., order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def empty_like(prototype: object, dtype: None = ..., order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def empty_like(prototype: Any, dtype: _DTypeLike[_SCT], order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def empty_like(prototype: Any, dtype: DTypeLike, order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def array(object: _ArrayType, dtype: None = ..., *, copy: bool | _CopyMode = ..., order: _OrderKACF = ..., subok: L[True], ndmin: int = ..., like: None | _SupportsArrayFunc = ...) -> _ArrayType:
...
@overload
def array(object: _ArrayLike[_SCT], dtype: None = ..., *, copy: bool | _CopyMode = ..., order: _OrderKACF = ..., subok: bool = ..., ndmin: int = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def array(object: object, dtype: None = ..., *, copy: bool | _CopyMode = ..., order: _OrderKACF = ..., subok: bool = ..., ndmin: int = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def array(object: Any, dtype: _DTypeLike[_SCT], *, copy: bool | _CopyMode = ..., order: _OrderKACF = ..., subok: bool = ..., ndmin: int = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def array(object: Any, dtype: DTypeLike, *, copy: bool | _CopyMode = ..., order: _OrderKACF = ..., subok: bool = ..., ndmin: int = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def zeros(shape: _ShapeLike, dtype: None = ..., order: _OrderCF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[float64]:
...
@overload
def zeros(shape: _ShapeLike, dtype: _DTypeLike[_SCT], order: _OrderCF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def zeros(shape: _ShapeLike, dtype: DTypeLike, order: _OrderCF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def empty(shape: _ShapeLike, dtype: None = ..., order: _OrderCF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[float64]:
...
@overload
def empty(shape: _ShapeLike, dtype: _DTypeLike[_SCT], order: _OrderCF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def empty(shape: _ShapeLike, dtype: DTypeLike, order: _OrderCF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def unravel_index(indices: _IntLike_co, shape: _ShapeLike, order: _OrderCF = ...) -> tuple[intp, ...]:
...
@overload
def unravel_index(indices: _ArrayLikeInt_co, shape: _ShapeLike, order: _OrderCF = ...) -> tuple[NDArray[intp], ...]:
...
@overload
def ravel_multi_index(multi_index: Sequence[_IntLike_co], dims: Sequence[SupportsIndex], mode: _ModeKind | tuple[_ModeKind, ...] = ..., order: _OrderCF = ...) -> intp:
...
@overload
def ravel_multi_index(multi_index: Sequence[_ArrayLikeInt_co], dims: Sequence[SupportsIndex], mode: _ModeKind | tuple[_ModeKind, ...] = ..., order: _OrderCF = ...) -> NDArray[intp]:
...
@overload
def concatenate(arrays: _ArrayLike[_SCT], /, axis: None | SupportsIndex = ..., out: None = ..., *, dtype: None = ..., casting: None | _CastingKind = ...) -> NDArray[_SCT]:
...
@overload
def concatenate(arrays: _SupportsLenAndGetItem[int, ArrayLike], /, axis: None | SupportsIndex = ..., out: None = ..., *, dtype: None = ..., casting: None | _CastingKind = ...) -> NDArray[Any]:
...
@overload
def concatenate(arrays: _SupportsLenAndGetItem[int, ArrayLike], /, axis: None | SupportsIndex = ..., out: None = ..., *, dtype: _DTypeLike[_SCT], casting: None | _CastingKind = ...) -> NDArray[_SCT]:
...
@overload
def concatenate(arrays: _SupportsLenAndGetItem[int, ArrayLike], /, axis: None | SupportsIndex = ..., out: None = ..., *, dtype: DTypeLike, casting: None | _CastingKind = ...) -> NDArray[Any]:
...
@overload
def concatenate(arrays: _SupportsLenAndGetItem[int, ArrayLike], /, axis: None | SupportsIndex = ..., out: _ArrayType = ..., *, dtype: DTypeLike = ..., casting: None | _CastingKind = ...) -> _ArrayType:
...
def inner(a: ArrayLike, b: ArrayLike, /) -> Any:
...
@overload
def where(condition: ArrayLike, /) -> tuple[NDArray[intp], ...]:
...
@overload
def where(condition: ArrayLike, x: ArrayLike, y: ArrayLike, /) -> NDArray[Any]:
...
def lexsort(keys: ArrayLike, axis: None | SupportsIndex = ...) -> Any:
...
def can_cast(from_: ArrayLike | DTypeLike, to: DTypeLike, casting: None | _CastingKind = ...) -> bool:
...
def min_scalar_type(a: ArrayLike, /) -> dtype[Any]:
...
def result_type(*arrays_and_dtypes: ArrayLike | DTypeLike) -> dtype[Any]:
...
@overload
def dot(a: ArrayLike, b: ArrayLike, out: None = ...) -> Any:
...
@overload
def dot(a: ArrayLike, b: ArrayLike, out: _ArrayType) -> _ArrayType:
...
@overload
def vdot(a: _ArrayLikeBool_co, b: _ArrayLikeBool_co, /) -> bool_:
...
@overload
def vdot(a: _ArrayLikeUInt_co, b: _ArrayLikeUInt_co, /) -> unsignedinteger[Any]:
...
@overload
def vdot(a: _ArrayLikeInt_co, b: _ArrayLikeInt_co, /) -> signedinteger[Any]:
...
@overload
def vdot(a: _ArrayLikeFloat_co, b: _ArrayLikeFloat_co, /) -> floating[Any]:
...
@overload
def vdot(a: _ArrayLikeComplex_co, b: _ArrayLikeComplex_co, /) -> complexfloating[Any, Any]:
...
@overload
def vdot(a: _ArrayLikeTD64_co, b: _ArrayLikeTD64_co, /) -> timedelta64:
...
@overload
def vdot(a: _ArrayLikeObject_co, b: Any, /) -> Any:
...
@overload
def vdot(a: Any, b: _ArrayLikeObject_co, /) -> Any:
...
def bincount(x: ArrayLike, /, weights: None | ArrayLike = ..., minlength: SupportsIndex = ...) -> NDArray[intp]:
...
def copyto(dst: NDArray[Any], src: ArrayLike, casting: None | _CastingKind = ..., where: None | _ArrayLikeBool_co = ...) -> None:
...
def putmask(a: NDArray[Any], /, mask: _ArrayLikeBool_co, values: ArrayLike) -> None:
...
def packbits(a: _ArrayLikeInt_co, /, axis: None | SupportsIndex = ..., bitorder: L["big", "little"] = ...) -> NDArray[uint8]:
...
def unpackbits(a: _ArrayLike[uint8], /, axis: None | SupportsIndex = ..., count: None | SupportsIndex = ..., bitorder: L["big", "little"] = ...) -> NDArray[uint8]:
...
def shares_memory(a: object, b: object, /, max_work: None | int = ...) -> bool:
...
def may_share_memory(a: object, b: object, /, max_work: None | int = ...) -> bool:
...
@overload
def asarray(a: _ArrayLike[_SCT], dtype: None = ..., order: _OrderKACF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def asarray(a: object, dtype: None = ..., order: _OrderKACF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def asarray(a: Any, dtype: _DTypeLike[_SCT], order: _OrderKACF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def asarray(a: Any, dtype: DTypeLike, order: _OrderKACF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def asanyarray(a: _ArrayType, dtype: None = ..., order: _OrderKACF = ..., *, like: None | _SupportsArrayFunc = ...) -> _ArrayType:
...
@overload
def asanyarray(a: _ArrayLike[_SCT], dtype: None = ..., order: _OrderKACF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def asanyarray(a: object, dtype: None = ..., order: _OrderKACF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def asanyarray(a: Any, dtype: _DTypeLike[_SCT], order: _OrderKACF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def asanyarray(a: Any, dtype: DTypeLike, order: _OrderKACF = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def ascontiguousarray(a: _ArrayLike[_SCT], dtype: None = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def ascontiguousarray(a: object, dtype: None = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def ascontiguousarray(a: Any, dtype: _DTypeLike[_SCT], *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def ascontiguousarray(a: Any, dtype: DTypeLike, *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def asfortranarray(a: _ArrayLike[_SCT], dtype: None = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def asfortranarray(a: object, dtype: None = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def asfortranarray(a: Any, dtype: _DTypeLike[_SCT], *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def asfortranarray(a: Any, dtype: DTypeLike, *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
def geterrobj() -> list[Any]:
...
def seterrobj(errobj: list[Any], /) -> None:
...
def promote_types(__type1: DTypeLike, __type2: DTypeLike) -> dtype[Any]:
...
@overload
def fromstring(string: str | bytes, dtype: None = ..., count: SupportsIndex = ..., *, sep: str, like: None | _SupportsArrayFunc = ...) -> NDArray[float64]:
...
@overload
def fromstring(string: str | bytes, dtype: _DTypeLike[_SCT], count: SupportsIndex = ..., *, sep: str, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def fromstring(string: str | bytes, dtype: DTypeLike, count: SupportsIndex = ..., *, sep: str, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
def frompyfunc(func: Callable[..., Any], /, nin: SupportsIndex, nout: SupportsIndex, *, identity: Any = ...) -> ufunc:
...
@overload
def fromfile(file: str | bytes | os.PathLike[Any] | _IOProtocol, dtype: None = ..., count: SupportsIndex = ..., sep: str = ..., offset: SupportsIndex = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[float64]:
...
@overload
def fromfile(file: str | bytes | os.PathLike[Any] | _IOProtocol, dtype: _DTypeLike[_SCT], count: SupportsIndex = ..., sep: str = ..., offset: SupportsIndex = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def fromfile(file: str | bytes | os.PathLike[Any] | _IOProtocol, dtype: DTypeLike, count: SupportsIndex = ..., sep: str = ..., offset: SupportsIndex = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def fromiter(iter: Iterable[Any], dtype: _DTypeLike[_SCT], count: SupportsIndex = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def fromiter(iter: Iterable[Any], dtype: DTypeLike, count: SupportsIndex = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def frombuffer(buffer: _SupportsBuffer, dtype: None = ..., count: SupportsIndex = ..., offset: SupportsIndex = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[float64]:
...
@overload
def frombuffer(buffer: _SupportsBuffer, dtype: _DTypeLike[_SCT], count: SupportsIndex = ..., offset: SupportsIndex = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def frombuffer(buffer: _SupportsBuffer, dtype: DTypeLike, count: SupportsIndex = ..., offset: SupportsIndex = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def arange(stop: _IntLike_co, /, *, dtype: None = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[signedinteger[Any]]:
...
@overload
def arange(start: _IntLike_co, stop: _IntLike_co, step: _IntLike_co = ..., dtype: None = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[signedinteger[Any]]:
...
@overload
def arange(stop: _FloatLike_co, /, *, dtype: None = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[floating[Any]]:
...
@overload
def arange(start: _FloatLike_co, stop: _FloatLike_co, step: _FloatLike_co = ..., dtype: None = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[floating[Any]]:
...
@overload
def arange(stop: _TD64Like_co, /, *, dtype: None = ..., like: None | _SupportsArrayFunc = ...) -> NDArray[timedelta64]:
...
@overload
def arange(start: _TD64Like_co, stop: _TD64Like_co, step: _TD64Like_co = ..., dtype: None = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[timedelta64]:
...
@overload
def arange(start: datetime64, stop: datetime64, step: datetime64 = ..., dtype: None = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[datetime64]:
...
@overload
def arange(stop: Any, /, *, dtype: _DTypeLike[_SCT], like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def arange(start: Any, stop: Any, step: Any = ..., dtype: _DTypeLike[_SCT] = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def arange(stop: Any, /, *, dtype: DTypeLike, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def arange(start: Any, stop: Any, step: Any = ..., dtype: DTypeLike = ..., *, like: None | _SupportsArrayFunc = ...) -> NDArray[Any]:
...
def datetime_data(dtype: str | _DTypeLike[datetime64] | _DTypeLike[timedelta64], /) -> tuple[str, int]:
...
@overload
def busday_count(begindates: _ScalarLike_co | dt.date, enddates: _ScalarLike_co | dt.date, weekmask: ArrayLike = ..., holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ..., busdaycal: None | busdaycalendar = ..., out: None = ...) -> int_:
...
@overload
def busday_count(begindates: ArrayLike | dt.date | _NestedSequence[dt.date], enddates: ArrayLike | dt.date | _NestedSequence[dt.date], weekmask: ArrayLike = ..., holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ..., busdaycal: None | busdaycalendar = ..., out: None = ...) -> NDArray[int_]:
...
@overload
def busday_count(begindates: ArrayLike | dt.date | _NestedSequence[dt.date], enddates: ArrayLike | dt.date | _NestedSequence[dt.date], weekmask: ArrayLike = ..., holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ..., busdaycal: None | busdaycalendar = ..., out: _ArrayType = ...) -> _ArrayType:
...
@overload
def busday_offset(dates: datetime64 | dt.date, offsets: _TD64Like_co | dt.timedelta, roll: L["raise"] = ..., weekmask: ArrayLike = ..., holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ..., busdaycal: None | busdaycalendar = ..., out: None = ...) -> datetime64:
...
@overload
def busday_offset(dates: _ArrayLike[datetime64] | dt.date | _NestedSequence[dt.date], offsets: _ArrayLikeTD64_co | dt.timedelta | _NestedSequence[dt.timedelta], roll: L["raise"] = ..., weekmask: ArrayLike = ..., holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ..., busdaycal: None | busdaycalendar = ..., out: None = ...) -> NDArray[datetime64]:
...
@overload
def busday_offset(dates: _ArrayLike[datetime64] | dt.date | _NestedSequence[dt.date], offsets: _ArrayLikeTD64_co | dt.timedelta | _NestedSequence[dt.timedelta], roll: L["raise"] = ..., weekmask: ArrayLike = ..., holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ..., busdaycal: None | busdaycalendar = ..., out: _ArrayType = ...) -> _ArrayType:
...
@overload
def busday_offset(dates: _ScalarLike_co | dt.date, offsets: _ScalarLike_co | dt.timedelta, roll: _RollKind, weekmask: ArrayLike = ..., holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ..., busdaycal: None | busdaycalendar = ..., out: None = ...) -> datetime64:
...
@overload
def busday_offset(dates: ArrayLike | dt.date | _NestedSequence[dt.date], offsets: ArrayLike | dt.timedelta | _NestedSequence[dt.timedelta], roll: _RollKind, weekmask: ArrayLike = ..., holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ..., busdaycal: None | busdaycalendar = ..., out: None = ...) -> NDArray[datetime64]:
...
@overload
def busday_offset(dates: ArrayLike | dt.date | _NestedSequence[dt.date], offsets: ArrayLike | dt.timedelta | _NestedSequence[dt.timedelta], roll: _RollKind, weekmask: ArrayLike = ..., holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ..., busdaycal: None | busdaycalendar = ..., out: _ArrayType = ...) -> _ArrayType:
...
@overload
def is_busday(dates: _ScalarLike_co | dt.date, weekmask: ArrayLike = ..., holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ..., busdaycal: None | busdaycalendar = ..., out: None = ...) -> bool_:
...
@overload
def is_busday(dates: ArrayLike | _NestedSequence[dt.date], weekmask: ArrayLike = ..., holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ..., busdaycal: None | busdaycalendar = ..., out: None = ...) -> NDArray[bool_]:
...
@overload
def is_busday(dates: ArrayLike | _NestedSequence[dt.date], weekmask: ArrayLike = ..., holidays: None | ArrayLike | dt.date | _NestedSequence[dt.date] = ..., busdaycal: None | busdaycalendar = ..., out: _ArrayType = ...) -> _ArrayType:
...
@overload
def datetime_as_string(arr: datetime64 | dt.date, unit: None | L["auto"] | _UnitKind = ..., timezone: L["naive", "UTC", "local"] | dt.tzinfo = ..., casting: _CastingKind = ...) -> str_:
...
@overload
def datetime_as_string(arr: _ArrayLikeDT64_co | _NestedSequence[dt.date], unit: None | L["auto"] | _UnitKind = ..., timezone: L["naive", "UTC", "local"] | dt.tzinfo = ..., casting: _CastingKind = ...) -> NDArray[str_]:
...
@overload
def compare_chararrays(a1: _ArrayLikeStr_co, a2: _ArrayLikeStr_co, cmp: L["<", "<=", "==", ">=", ">", "!="], rstrip: bool) -> NDArray[bool_]:
...
@overload
def compare_chararrays(a1: _ArrayLikeBytes_co, a2: _ArrayLikeBytes_co, cmp: L["<", "<=", "==", ">=", ">", "!="], rstrip: bool) -> NDArray[bool_]:
...
def add_docstring(obj: Callable[..., Any], docstring: str, /) -> None:
...
_GetItemKeys = L["C", "CONTIGUOUS", "C_CONTIGUOUS", "F", "FORTRAN", "F_CONTIGUOUS", "W", "WRITEABLE", "B", "BEHAVED", "O", "OWNDATA", "A", "ALIGNED", "X", "WRITEBACKIFCOPY", "CA", "CARRAY", "FA", "FARRAY", "FNC", "FORC",]
_SetItemKeys = L["A", "ALIGNED", "W", "WRITEABLE", "X", "WRITEBACKIFCOPY",]
@final
class flagsobj:
__hash__: ClassVar[None]
aligned: bool
writeable: bool
writebackifcopy: bool
@property
def behaved(self) -> bool:
...
@property
def c_contiguous(self) -> bool:
...
@property
def carray(self) -> bool:
...
@property
def contiguous(self) -> bool:
...
@property
def f_contiguous(self) -> bool:
...
@property
def farray(self) -> bool:
...
@property
def fnc(self) -> bool:
...
@property
def forc(self) -> bool:
...
@property
def fortran(self) -> bool:
...
@property
def num(self) -> int:
...
@property
def owndata(self) -> bool:
...
def __getitem__(self, key: _GetItemKeys) -> bool:
...
def __setitem__(self, key: _SetItemKeys, value: bool) -> None:
...
def nested_iters(op: ArrayLike | Sequence[ArrayLike], axes: Sequence[Sequence[SupportsIndex]], flags: None | Sequence[_NDIterFlagsKind] = ..., op_flags: None | Sequence[Sequence[_NDIterOpFlagsKind]] = ..., op_dtypes: DTypeLike | Sequence[DTypeLike] = ..., order: _OrderKACF = ..., casting: _CastingKind = ..., buffersize: SupportsIndex = ...) -> tuple[nditer, ...]:
...

View file

@ -0,0 +1,359 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Callable, Sequence
from typing import Any, Literal, NoReturn, SupportsAbs, SupportsIndex, TypeGuard, TypeVar, overload
from typing_extensions import TypeGuard
from numpy import _OrderCF, _OrderKACF, bool_, complexfloating, float64, floating, generic, int_, intp, object_, signedinteger, timedelta64, unsignedinteger
from numpy._typing import ArrayLike, DTypeLike, NDArray, _ArrayLike, _ArrayLikeBool_co, _ArrayLikeComplex_co, _ArrayLikeFloat_co, _ArrayLikeInt_co, _ArrayLikeObject_co, _ArrayLikeTD64_co, _ArrayLikeUInt_co, _ArrayLikeUnknown, _DTypeLike, _ScalarLike_co, _ShapeLike, _SupportsArrayFunc
if sys.version_info >= (3, 10):
...
else:
...
_T = TypeVar("_T")
_SCT = TypeVar("_SCT", bound=generic)
_ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
_CorrelateMode = Literal["valid", "same", "full"]
__all__: list[str]
@overload
def zeros_like(a: _ArrayType, dtype: None = ..., order: _OrderKACF = ..., subok: Literal[True] = ..., shape: None = ...) -> _ArrayType:
...
@overload
def zeros_like(a: _ArrayLike[_SCT], dtype: None = ..., order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def zeros_like(a: object, dtype: None = ..., order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def zeros_like(a: Any, dtype: _DTypeLike[_SCT], order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def zeros_like(a: Any, dtype: DTypeLike, order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def ones(shape: _ShapeLike, dtype: None = ..., order: _OrderCF = ..., *, like: _SupportsArrayFunc = ...) -> NDArray[float64]:
...
@overload
def ones(shape: _ShapeLike, dtype: _DTypeLike[_SCT], order: _OrderCF = ..., *, like: _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def ones(shape: _ShapeLike, dtype: DTypeLike, order: _OrderCF = ..., *, like: _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def ones_like(a: _ArrayType, dtype: None = ..., order: _OrderKACF = ..., subok: Literal[True] = ..., shape: None = ...) -> _ArrayType:
...
@overload
def ones_like(a: _ArrayLike[_SCT], dtype: None = ..., order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def ones_like(a: object, dtype: None = ..., order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def ones_like(a: Any, dtype: _DTypeLike[_SCT], order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def ones_like(a: Any, dtype: DTypeLike, order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def full(shape: _ShapeLike, fill_value: Any, dtype: None = ..., order: _OrderCF = ..., *, like: _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def full(shape: _ShapeLike, fill_value: Any, dtype: _DTypeLike[_SCT], order: _OrderCF = ..., *, like: _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def full(shape: _ShapeLike, fill_value: Any, dtype: DTypeLike, order: _OrderCF = ..., *, like: _SupportsArrayFunc = ...) -> NDArray[Any]:
...
@overload
def full_like(a: _ArrayType, fill_value: Any, dtype: None = ..., order: _OrderKACF = ..., subok: Literal[True] = ..., shape: None = ...) -> _ArrayType:
...
@overload
def full_like(a: _ArrayLike[_SCT], fill_value: Any, dtype: None = ..., order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def full_like(a: object, fill_value: Any, dtype: None = ..., order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def full_like(a: Any, fill_value: Any, dtype: _DTypeLike[_SCT], order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def full_like(a: Any, fill_value: Any, dtype: DTypeLike, order: _OrderKACF = ..., subok: bool = ..., shape: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def count_nonzero(a: ArrayLike, axis: None = ..., *, keepdims: Literal[False] = ...) -> int:
...
@overload
def count_nonzero(a: ArrayLike, axis: _ShapeLike = ..., *, keepdims: bool = ...) -> Any:
...
def isfortran(a: NDArray[Any] | generic) -> bool:
...
def argwhere(a: ArrayLike) -> NDArray[intp]:
...
def flatnonzero(a: ArrayLike) -> NDArray[intp]:
...
@overload
def correlate(a: _ArrayLikeUnknown, v: _ArrayLikeUnknown, mode: _CorrelateMode = ...) -> NDArray[Any]:
...
@overload
def correlate(a: _ArrayLikeBool_co, v: _ArrayLikeBool_co, mode: _CorrelateMode = ...) -> NDArray[bool_]:
...
@overload
def correlate(a: _ArrayLikeUInt_co, v: _ArrayLikeUInt_co, mode: _CorrelateMode = ...) -> NDArray[unsignedinteger[Any]]:
...
@overload
def correlate(a: _ArrayLikeInt_co, v: _ArrayLikeInt_co, mode: _CorrelateMode = ...) -> NDArray[signedinteger[Any]]:
...
@overload
def correlate(a: _ArrayLikeFloat_co, v: _ArrayLikeFloat_co, mode: _CorrelateMode = ...) -> NDArray[floating[Any]]:
...
@overload
def correlate(a: _ArrayLikeComplex_co, v: _ArrayLikeComplex_co, mode: _CorrelateMode = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def correlate(a: _ArrayLikeTD64_co, v: _ArrayLikeTD64_co, mode: _CorrelateMode = ...) -> NDArray[timedelta64]:
...
@overload
def correlate(a: _ArrayLikeObject_co, v: _ArrayLikeObject_co, mode: _CorrelateMode = ...) -> NDArray[object_]:
...
@overload
def convolve(a: _ArrayLikeUnknown, v: _ArrayLikeUnknown, mode: _CorrelateMode = ...) -> NDArray[Any]:
...
@overload
def convolve(a: _ArrayLikeBool_co, v: _ArrayLikeBool_co, mode: _CorrelateMode = ...) -> NDArray[bool_]:
...
@overload
def convolve(a: _ArrayLikeUInt_co, v: _ArrayLikeUInt_co, mode: _CorrelateMode = ...) -> NDArray[unsignedinteger[Any]]:
...
@overload
def convolve(a: _ArrayLikeInt_co, v: _ArrayLikeInt_co, mode: _CorrelateMode = ...) -> NDArray[signedinteger[Any]]:
...
@overload
def convolve(a: _ArrayLikeFloat_co, v: _ArrayLikeFloat_co, mode: _CorrelateMode = ...) -> NDArray[floating[Any]]:
...
@overload
def convolve(a: _ArrayLikeComplex_co, v: _ArrayLikeComplex_co, mode: _CorrelateMode = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def convolve(a: _ArrayLikeTD64_co, v: _ArrayLikeTD64_co, mode: _CorrelateMode = ...) -> NDArray[timedelta64]:
...
@overload
def convolve(a: _ArrayLikeObject_co, v: _ArrayLikeObject_co, mode: _CorrelateMode = ...) -> NDArray[object_]:
...
@overload
def outer(a: _ArrayLikeUnknown, b: _ArrayLikeUnknown, out: None = ...) -> NDArray[Any]:
...
@overload
def outer(a: _ArrayLikeBool_co, b: _ArrayLikeBool_co, out: None = ...) -> NDArray[bool_]:
...
@overload
def outer(a: _ArrayLikeUInt_co, b: _ArrayLikeUInt_co, out: None = ...) -> NDArray[unsignedinteger[Any]]:
...
@overload
def outer(a: _ArrayLikeInt_co, b: _ArrayLikeInt_co, out: None = ...) -> NDArray[signedinteger[Any]]:
...
@overload
def outer(a: _ArrayLikeFloat_co, b: _ArrayLikeFloat_co, out: None = ...) -> NDArray[floating[Any]]:
...
@overload
def outer(a: _ArrayLikeComplex_co, b: _ArrayLikeComplex_co, out: None = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def outer(a: _ArrayLikeTD64_co, b: _ArrayLikeTD64_co, out: None = ...) -> NDArray[timedelta64]:
...
@overload
def outer(a: _ArrayLikeObject_co, b: _ArrayLikeObject_co, out: None = ...) -> NDArray[object_]:
...
@overload
def outer(a: _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeObject_co, b: _ArrayLikeComplex_co | _ArrayLikeTD64_co | _ArrayLikeObject_co, out: _ArrayType) -> _ArrayType:
...
@overload
def tensordot(a: _ArrayLikeUnknown, b: _ArrayLikeUnknown, axes: int | tuple[_ShapeLike, _ShapeLike] = ...) -> NDArray[Any]:
...
@overload
def tensordot(a: _ArrayLikeBool_co, b: _ArrayLikeBool_co, axes: int | tuple[_ShapeLike, _ShapeLike] = ...) -> NDArray[bool_]:
...
@overload
def tensordot(a: _ArrayLikeUInt_co, b: _ArrayLikeUInt_co, axes: int | tuple[_ShapeLike, _ShapeLike] = ...) -> NDArray[unsignedinteger[Any]]:
...
@overload
def tensordot(a: _ArrayLikeInt_co, b: _ArrayLikeInt_co, axes: int | tuple[_ShapeLike, _ShapeLike] = ...) -> NDArray[signedinteger[Any]]:
...
@overload
def tensordot(a: _ArrayLikeFloat_co, b: _ArrayLikeFloat_co, axes: int | tuple[_ShapeLike, _ShapeLike] = ...) -> NDArray[floating[Any]]:
...
@overload
def tensordot(a: _ArrayLikeComplex_co, b: _ArrayLikeComplex_co, axes: int | tuple[_ShapeLike, _ShapeLike] = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def tensordot(a: _ArrayLikeTD64_co, b: _ArrayLikeTD64_co, axes: int | tuple[_ShapeLike, _ShapeLike] = ...) -> NDArray[timedelta64]:
...
@overload
def tensordot(a: _ArrayLikeObject_co, b: _ArrayLikeObject_co, axes: int | tuple[_ShapeLike, _ShapeLike] = ...) -> NDArray[object_]:
...
@overload
def roll(a: _ArrayLike[_SCT], shift: _ShapeLike, axis: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def roll(a: ArrayLike, shift: _ShapeLike, axis: None | _ShapeLike = ...) -> NDArray[Any]:
...
def rollaxis(a: NDArray[_SCT], axis: int, start: int = ...) -> NDArray[_SCT]:
...
def moveaxis(a: NDArray[_SCT], source: _ShapeLike, destination: _ShapeLike) -> NDArray[_SCT]:
...
@overload
def cross(a: _ArrayLikeUnknown, b: _ArrayLikeUnknown, axisa: int = ..., axisb: int = ..., axisc: int = ..., axis: None | int = ...) -> NDArray[Any]:
...
@overload
def cross(a: _ArrayLikeBool_co, b: _ArrayLikeBool_co, axisa: int = ..., axisb: int = ..., axisc: int = ..., axis: None | int = ...) -> NoReturn:
...
@overload
def cross(a: _ArrayLikeUInt_co, b: _ArrayLikeUInt_co, axisa: int = ..., axisb: int = ..., axisc: int = ..., axis: None | int = ...) -> NDArray[unsignedinteger[Any]]:
...
@overload
def cross(a: _ArrayLikeInt_co, b: _ArrayLikeInt_co, axisa: int = ..., axisb: int = ..., axisc: int = ..., axis: None | int = ...) -> NDArray[signedinteger[Any]]:
...
@overload
def cross(a: _ArrayLikeFloat_co, b: _ArrayLikeFloat_co, axisa: int = ..., axisb: int = ..., axisc: int = ..., axis: None | int = ...) -> NDArray[floating[Any]]:
...
@overload
def cross(a: _ArrayLikeComplex_co, b: _ArrayLikeComplex_co, axisa: int = ..., axisb: int = ..., axisc: int = ..., axis: None | int = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def cross(a: _ArrayLikeObject_co, b: _ArrayLikeObject_co, axisa: int = ..., axisb: int = ..., axisc: int = ..., axis: None | int = ...) -> NDArray[object_]:
...
@overload
def indices(dimensions: Sequence[int], dtype: type[int] = ..., sparse: Literal[False] = ...) -> NDArray[int_]:
...
@overload
def indices(dimensions: Sequence[int], dtype: type[int] = ..., sparse: Literal[True] = ...) -> tuple[NDArray[int_], ...]:
...
@overload
def indices(dimensions: Sequence[int], dtype: _DTypeLike[_SCT], sparse: Literal[False] = ...) -> NDArray[_SCT]:
...
@overload
def indices(dimensions: Sequence[int], dtype: _DTypeLike[_SCT], sparse: Literal[True]) -> tuple[NDArray[_SCT], ...]:
...
@overload
def indices(dimensions: Sequence[int], dtype: DTypeLike, sparse: Literal[False] = ...) -> NDArray[Any]:
...
@overload
def indices(dimensions: Sequence[int], dtype: DTypeLike, sparse: Literal[True]) -> tuple[NDArray[Any], ...]:
...
def fromfunction(function: Callable[..., _T], shape: Sequence[int], *, dtype: DTypeLike = ..., like: _SupportsArrayFunc = ..., **kwargs: Any) -> _T:
...
def isscalar(element: object) -> TypeGuard[generic | bool | int | float | complex | str | bytes | memoryview]:
...
def binary_repr(num: SupportsIndex, width: None | int = ...) -> str:
...
def base_repr(number: SupportsAbs[float], base: float = ..., padding: SupportsIndex = ...) -> str:
...
@overload
def identity(n: int, dtype: None = ..., *, like: _SupportsArrayFunc = ...) -> NDArray[float64]:
...
@overload
def identity(n: int, dtype: _DTypeLike[_SCT], *, like: _SupportsArrayFunc = ...) -> NDArray[_SCT]:
...
@overload
def identity(n: int, dtype: DTypeLike, *, like: _SupportsArrayFunc = ...) -> NDArray[Any]:
...
def allclose(a: ArrayLike, b: ArrayLike, rtol: float = ..., atol: float = ..., equal_nan: bool = ...) -> bool:
...
@overload
def isclose(a: _ScalarLike_co, b: _ScalarLike_co, rtol: float = ..., atol: float = ..., equal_nan: bool = ...) -> bool_:
...
@overload
def isclose(a: ArrayLike, b: ArrayLike, rtol: float = ..., atol: float = ..., equal_nan: bool = ...) -> NDArray[bool_]:
...
def array_equal(a1: ArrayLike, a2: ArrayLike, equal_nan: bool = ...) -> bool:
...
def array_equiv(a1: ArrayLike, a2: ArrayLike) -> bool:
...

View file

@ -0,0 +1,103 @@
"""
This type stub file was generated by pyright.
"""
import sys
import types
from typing import Any, Literal as L, Protocol, TypeVar, TypedDict, Union, overload
from numpy import bool_, byte, bytes_, cdouble, clongdouble, csingle, datetime64, double, dtype, generic, half, int_, intc, longdouble, longlong, ndarray, object_, short, single, str_, timedelta64, ubyte, uint, uintc, ulonglong, ushort, void
from numpy._typing import ArrayLike, DTypeLike, _DTypeLike
_T = TypeVar("_T")
_SCT = TypeVar("_SCT", bound=generic)
class _CastFunc(Protocol):
def __call__(self, x: ArrayLike, k: DTypeLike = ...) -> ndarray[Any, dtype[Any]]:
...
class _TypeCodes(TypedDict):
Character: L['c']
Integer: L['bhilqp']
UnsignedInteger: L['BHILQP']
Float: L['efdg']
Complex: L['FDG']
AllInteger: L['bBhHiIlLqQpP']
AllFloat: L['efdgFDG']
Datetime: L['Mm']
All: L['?bhilqpBHILQPefdgFDGSUVOMm']
...
class _typedict(dict[type[generic], _T]):
def __getitem__(self, key: DTypeLike) -> _T:
...
if sys.version_info >= (3, 10):
_TypeTuple = Union[type[Any], types.UnionType, tuple[Union[type[Any], types.UnionType, tuple[Any, ...]], ...],]
else:
...
__all__: list[str]
@overload
def maximum_sctype(t: _DTypeLike[_SCT]) -> type[_SCT]:
...
@overload
def maximum_sctype(t: DTypeLike) -> type[Any]:
...
@overload
def issctype(rep: dtype[Any] | type[Any]) -> bool:
...
@overload
def issctype(rep: object) -> L[False]:
...
@overload
def obj2sctype(rep: _DTypeLike[_SCT], default: None = ...) -> None | type[_SCT]:
...
@overload
def obj2sctype(rep: _DTypeLike[_SCT], default: _T) -> _T | type[_SCT]:
...
@overload
def obj2sctype(rep: DTypeLike, default: None = ...) -> None | type[Any]:
...
@overload
def obj2sctype(rep: DTypeLike, default: _T) -> _T | type[Any]:
...
@overload
def obj2sctype(rep: object, default: None = ...) -> None:
...
@overload
def obj2sctype(rep: object, default: _T) -> _T:
...
@overload
def issubclass_(arg1: type[Any], arg2: _TypeTuple) -> bool:
...
@overload
def issubclass_(arg1: object, arg2: object) -> L[False]:
...
def issubsctype(arg1: DTypeLike, arg2: DTypeLike) -> bool:
...
def issubdtype(arg1: DTypeLike, arg2: DTypeLike) -> bool:
...
def sctype2char(sctype: DTypeLike) -> str:
...
cast: _typedict[_CastFunc]
nbytes: _typedict[int]
typecodes: _TypeCodes
ScalarType: tuple[type[int], type[float], type[complex], type[bool], type[bytes], type[str], type[memoryview], type[bool_], type[csingle], type[cdouble], type[clongdouble], type[half], type[single], type[double], type[longdouble], type[byte], type[short], type[intc], type[int_], type[longlong], type[timedelta64], type[datetime64], type[object_], type[bytes_], type[str_], type[ubyte], type[ushort], type[uintc], type[uint], type[ulonglong], type[void],]

View file

@ -0,0 +1,85 @@
"""
This type stub file was generated by pyright.
"""
import os
from collections.abc import Iterable, Sequence
from typing import Any, Protocol, TypeVar, overload
from numpy import _ByteOrder, _SupportsBuffer, dtype, generic, recarray as recarray, record as record
from numpy._typing import ArrayLike, DTypeLike, NDArray, _ArrayLikeVoid_co, _NestedSequence, _ShapeLike
_SCT = TypeVar("_SCT", bound=generic)
_RecArray = recarray[Any, dtype[_SCT]]
class _SupportsReadInto(Protocol):
def seek(self, offset: int, whence: int, /) -> object:
...
def tell(self, /) -> int:
...
def readinto(self, buffer: memoryview, /) -> int:
...
__all__: list[str]
@overload
def fromarrays(arrayList: Iterable[ArrayLike], dtype: DTypeLike = ..., shape: None | _ShapeLike = ..., formats: None = ..., names: None = ..., titles: None = ..., aligned: bool = ..., byteorder: None = ...) -> _RecArray[Any]:
...
@overload
def fromarrays(arrayList: Iterable[ArrayLike], dtype: None = ..., shape: None | _ShapeLike = ..., *, formats: DTypeLike, names: None | str | Sequence[str] = ..., titles: None | str | Sequence[str] = ..., aligned: bool = ..., byteorder: None | _ByteOrder = ...) -> _RecArray[record]:
...
@overload
def fromrecords(recList: _ArrayLikeVoid_co | tuple[Any, ...] | _NestedSequence[tuple[Any, ...]], dtype: DTypeLike = ..., shape: None | _ShapeLike = ..., formats: None = ..., names: None = ..., titles: None = ..., aligned: bool = ..., byteorder: None = ...) -> _RecArray[record]:
...
@overload
def fromrecords(recList: _ArrayLikeVoid_co | tuple[Any, ...] | _NestedSequence[tuple[Any, ...]], dtype: None = ..., shape: None | _ShapeLike = ..., *, formats: DTypeLike, names: None | str | Sequence[str] = ..., titles: None | str | Sequence[str] = ..., aligned: bool = ..., byteorder: None | _ByteOrder = ...) -> _RecArray[record]:
...
@overload
def fromstring(datastring: _SupportsBuffer, dtype: DTypeLike, shape: None | _ShapeLike = ..., offset: int = ..., formats: None = ..., names: None = ..., titles: None = ..., aligned: bool = ..., byteorder: None = ...) -> _RecArray[record]:
...
@overload
def fromstring(datastring: _SupportsBuffer, dtype: None = ..., shape: None | _ShapeLike = ..., offset: int = ..., *, formats: DTypeLike, names: None | str | Sequence[str] = ..., titles: None | str | Sequence[str] = ..., aligned: bool = ..., byteorder: None | _ByteOrder = ...) -> _RecArray[record]:
...
@overload
def fromfile(fd: str | bytes | os.PathLike[str] | os.PathLike[bytes] | _SupportsReadInto, dtype: DTypeLike, shape: None | _ShapeLike = ..., offset: int = ..., formats: None = ..., names: None = ..., titles: None = ..., aligned: bool = ..., byteorder: None = ...) -> _RecArray[Any]:
...
@overload
def fromfile(fd: str | bytes | os.PathLike[str] | os.PathLike[bytes] | _SupportsReadInto, dtype: None = ..., shape: None | _ShapeLike = ..., offset: int = ..., *, formats: DTypeLike, names: None | str | Sequence[str] = ..., titles: None | str | Sequence[str] = ..., aligned: bool = ..., byteorder: None | _ByteOrder = ...) -> _RecArray[record]:
...
@overload
def array(obj: _SCT | NDArray[_SCT], dtype: None = ..., shape: None | _ShapeLike = ..., offset: int = ..., formats: None = ..., names: None = ..., titles: None = ..., aligned: bool = ..., byteorder: None = ..., copy: bool = ...) -> _RecArray[_SCT]:
...
@overload
def array(obj: ArrayLike, dtype: DTypeLike, shape: None | _ShapeLike = ..., offset: int = ..., formats: None = ..., names: None = ..., titles: None = ..., aligned: bool = ..., byteorder: None = ..., copy: bool = ...) -> _RecArray[Any]:
...
@overload
def array(obj: ArrayLike, dtype: None = ..., shape: None | _ShapeLike = ..., offset: int = ..., *, formats: DTypeLike, names: None | str | Sequence[str] = ..., titles: None | str | Sequence[str] = ..., aligned: bool = ..., byteorder: None | _ByteOrder = ..., copy: bool = ...) -> _RecArray[record]:
...
@overload
def array(obj: None, dtype: DTypeLike, shape: _ShapeLike, offset: int = ..., formats: None = ..., names: None = ..., titles: None = ..., aligned: bool = ..., byteorder: None = ..., copy: bool = ...) -> _RecArray[Any]:
...
@overload
def array(obj: None, dtype: None = ..., *, shape: _ShapeLike, offset: int = ..., formats: DTypeLike, names: None | str | Sequence[str] = ..., titles: None | str | Sequence[str] = ..., aligned: bool = ..., byteorder: None | _ByteOrder = ..., copy: bool = ...) -> _RecArray[record]:
...
@overload
def array(obj: _SupportsReadInto, dtype: DTypeLike, shape: None | _ShapeLike = ..., offset: int = ..., formats: None = ..., names: None = ..., titles: None = ..., aligned: bool = ..., byteorder: None = ..., copy: bool = ...) -> _RecArray[Any]:
...
@overload
def array(obj: _SupportsReadInto, dtype: None = ..., shape: None | _ShapeLike = ..., offset: int = ..., *, formats: DTypeLike, names: None | str | Sequence[str] = ..., titles: None | str | Sequence[str] = ..., aligned: bool = ..., byteorder: None | _ByteOrder = ..., copy: bool = ...) -> _RecArray[record]:
...

View file

@ -0,0 +1,96 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Sequence
from typing import Any, SupportsIndex, TypeVar, overload
from numpy import _CastingKind, generic
from numpy._typing import ArrayLike, DTypeLike, NDArray, _ArrayLike, _DTypeLike
_SCT = TypeVar("_SCT", bound=generic)
_ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
__all__: list[str]
@overload
def atleast_1d(arys: _ArrayLike[_SCT], /) -> NDArray[_SCT]:
...
@overload
def atleast_1d(arys: ArrayLike, /) -> NDArray[Any]:
...
@overload
def atleast_1d(*arys: ArrayLike) -> list[NDArray[Any]]:
...
@overload
def atleast_2d(arys: _ArrayLike[_SCT], /) -> NDArray[_SCT]:
...
@overload
def atleast_2d(arys: ArrayLike, /) -> NDArray[Any]:
...
@overload
def atleast_2d(*arys: ArrayLike) -> list[NDArray[Any]]:
...
@overload
def atleast_3d(arys: _ArrayLike[_SCT], /) -> NDArray[_SCT]:
...
@overload
def atleast_3d(arys: ArrayLike, /) -> NDArray[Any]:
...
@overload
def atleast_3d(*arys: ArrayLike) -> list[NDArray[Any]]:
...
@overload
def vstack(tup: Sequence[_ArrayLike[_SCT]], *, dtype: None = ..., casting: _CastingKind = ...) -> NDArray[_SCT]:
...
@overload
def vstack(tup: Sequence[ArrayLike], *, dtype: _DTypeLike[_SCT], casting: _CastingKind = ...) -> NDArray[_SCT]:
...
@overload
def vstack(tup: Sequence[ArrayLike], *, dtype: DTypeLike = ..., casting: _CastingKind = ...) -> NDArray[Any]:
...
@overload
def hstack(tup: Sequence[_ArrayLike[_SCT]], *, dtype: None = ..., casting: _CastingKind = ...) -> NDArray[_SCT]:
...
@overload
def hstack(tup: Sequence[ArrayLike], *, dtype: _DTypeLike[_SCT], casting: _CastingKind = ...) -> NDArray[_SCT]:
...
@overload
def hstack(tup: Sequence[ArrayLike], *, dtype: DTypeLike = ..., casting: _CastingKind = ...) -> NDArray[Any]:
...
@overload
def stack(arrays: Sequence[_ArrayLike[_SCT]], axis: SupportsIndex = ..., out: None = ..., *, dtype: None = ..., casting: _CastingKind = ...) -> NDArray[_SCT]:
...
@overload
def stack(arrays: Sequence[ArrayLike], axis: SupportsIndex = ..., out: None = ..., *, dtype: _DTypeLike[_SCT], casting: _CastingKind = ...) -> NDArray[_SCT]:
...
@overload
def stack(arrays: Sequence[ArrayLike], axis: SupportsIndex = ..., out: None = ..., *, dtype: DTypeLike = ..., casting: _CastingKind = ...) -> NDArray[Any]:
...
@overload
def stack(arrays: Sequence[ArrayLike], axis: SupportsIndex = ..., out: _ArrayType = ..., *, dtype: DTypeLike = ..., casting: _CastingKind = ...) -> _ArrayType:
...
@overload
def block(arrays: _ArrayLike[_SCT]) -> NDArray[_SCT]:
...
@overload
def block(arrays: ArrayLike) -> NDArray[Any]:
...

View file

@ -0,0 +1,14 @@
"""
This type stub file was generated by pyright.
"""
from ._multiarray_umath import *
"""
Create the numpy.core.umath namespace for backward compatibility. In v1.16
the multiarray and umath c-extension modules were merged into a single
_multiarray_umath extension module. So we replicate the old namespace
by importing from the extension module.
"""
__all__ = ['_UFUNC_API', 'ERR_CALL', 'ERR_DEFAULT', 'ERR_IGNORE', 'ERR_LOG', 'ERR_PRINT', 'ERR_RAISE', 'ERR_WARN', 'FLOATING_POINT_SUPPORT', 'FPE_DIVIDEBYZERO', 'FPE_INVALID', 'FPE_OVERFLOW', 'FPE_UNDERFLOW', 'NAN', 'NINF', 'NZERO', 'PINF', 'PZERO', 'SHIFT_DIVIDEBYZERO', 'SHIFT_INVALID', 'SHIFT_OVERFLOW', 'SHIFT_UNDERFLOW', 'UFUNC_BUFSIZE_DEFAULT', 'UFUNC_PYVALS_NAME', '_add_newdoc_ufunc', 'absolute', 'add', 'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctan2', 'arctanh', 'bitwise_and', 'bitwise_or', 'bitwise_xor', 'cbrt', 'ceil', 'conj', 'conjugate', 'copysign', 'cos', 'cosh', 'deg2rad', 'degrees', 'divide', 'divmod', 'e', 'equal', 'euler_gamma', 'exp', 'exp2', 'expm1', 'fabs', 'floor', 'floor_divide', 'float_power', 'fmax', 'fmin', 'fmod', 'frexp', 'frompyfunc', 'gcd', 'geterrobj', 'greater', 'greater_equal', 'heaviside', 'hypot', 'invert', 'isfinite', 'isinf', 'isnan', 'isnat', 'lcm', 'ldexp', 'left_shift', 'less', 'less_equal', 'log', 'log10', 'log1p', 'log2', 'logaddexp', 'logaddexp2', 'logical_and', 'logical_not', 'logical_or', 'logical_xor', 'maximum', 'minimum', 'mod', 'modf', 'multiply', 'negative', 'nextafter', 'not_equal', 'pi', 'positive', 'power', 'rad2deg', 'radians', 'reciprocal', 'remainder', 'right_shift', 'rint', 'seterrobj', 'sign', 'signbit', 'sin', 'sinh', 'spacing', 'sqrt', 'square', 'subtract', 'tan', 'tanh', 'true_divide', 'trunc']

265
typings/numpy/ctypeslib.pyi Normal file
View file

@ -0,0 +1,265 @@
"""
This type stub file was generated by pyright.
"""
import os
import ctypes
from ctypes import c_int64 as _c_intp
from collections.abc import Iterable, Sequence
from typing import Any, ClassVar, Generic, Literal as L, TypeVar, overload
from numpy import bool_, byte, double, dtype, generic, int_, intc, longdouble, longlong, ndarray, short, single, ubyte, uint, uintc, ulonglong, ushort, void
from numpy.core._internal import _ctypes
from numpy.core.multiarray import flagsobj
from numpy._typing import DTypeLike, NDArray, _ArrayLike, _BoolCodes, _ByteCodes, _DTypeLike, _DoubleCodes, _IntCCodes, _IntCodes, _LongDoubleCodes, _LongLongCodes, _ShapeLike, _ShortCodes, _SingleCodes, _UByteCodes, _UIntCCodes, _UIntCodes, _ULongLongCodes, _UShortCodes, _VoidDTypeLike
_DType = TypeVar("_DType", bound=dtype[Any])
_DTypeOptional = TypeVar("_DTypeOptional", bound=None | dtype[Any])
_SCT = TypeVar("_SCT", bound=generic)
_FlagsKind = L['C_CONTIGUOUS', 'CONTIGUOUS', 'C', 'F_CONTIGUOUS', 'FORTRAN', 'F', 'ALIGNED', 'A', 'WRITEABLE', 'W', 'OWNDATA', 'O', 'WRITEBACKIFCOPY', 'X',]
class _ndptr(ctypes.c_void_p, Generic[_DTypeOptional]):
_dtype_: ClassVar[_DTypeOptional]
_shape_: ClassVar[None]
_ndim_: ClassVar[None | int]
_flags_: ClassVar[None | list[_FlagsKind]]
@overload
@classmethod
def from_param(cls: type[_ndptr[None]], obj: ndarray[Any, Any]) -> _ctypes[Any]:
...
@overload
@classmethod
def from_param(cls: type[_ndptr[_DType]], obj: ndarray[Any, _DType]) -> _ctypes[Any]:
...
class _concrete_ndptr(_ndptr[_DType]):
_dtype_: ClassVar[_DType]
_shape_: ClassVar[tuple[int, ...]]
@property
def contents(self) -> ndarray[Any, _DType]:
...
def load_library(libname: str | bytes | os.PathLike[str] | os.PathLike[bytes], loader_path: str | bytes | os.PathLike[str] | os.PathLike[bytes]) -> ctypes.CDLL:
...
__all__: list[str]
c_intp = _c_intp
@overload
def ndpointer(dtype: None = ..., ndim: int = ..., shape: None | _ShapeLike = ..., flags: None | _FlagsKind | Iterable[_FlagsKind] | int | flagsobj = ...) -> type[_ndptr[None]]:
...
@overload
def ndpointer(dtype: _DTypeLike[_SCT], ndim: int = ..., *, shape: _ShapeLike, flags: None | _FlagsKind | Iterable[_FlagsKind] | int | flagsobj = ...) -> type[_concrete_ndptr[dtype[_SCT]]]:
...
@overload
def ndpointer(dtype: DTypeLike, ndim: int = ..., *, shape: _ShapeLike, flags: None | _FlagsKind | Iterable[_FlagsKind] | int | flagsobj = ...) -> type[_concrete_ndptr[dtype[Any]]]:
...
@overload
def ndpointer(dtype: _DTypeLike[_SCT], ndim: int = ..., shape: None = ..., flags: None | _FlagsKind | Iterable[_FlagsKind] | int | flagsobj = ...) -> type[_ndptr[dtype[_SCT]]]:
...
@overload
def ndpointer(dtype: DTypeLike, ndim: int = ..., shape: None = ..., flags: None | _FlagsKind | Iterable[_FlagsKind] | int | flagsobj = ...) -> type[_ndptr[dtype[Any]]]:
...
@overload
def as_ctypes_type(dtype: _BoolCodes | _DTypeLike[bool_] | type[ctypes.c_bool]) -> type[ctypes.c_bool]:
...
@overload
def as_ctypes_type(dtype: _ByteCodes | _DTypeLike[byte] | type[ctypes.c_byte]) -> type[ctypes.c_byte]:
...
@overload
def as_ctypes_type(dtype: _ShortCodes | _DTypeLike[short] | type[ctypes.c_short]) -> type[ctypes.c_short]:
...
@overload
def as_ctypes_type(dtype: _IntCCodes | _DTypeLike[intc] | type[ctypes.c_int]) -> type[ctypes.c_int]:
...
@overload
def as_ctypes_type(dtype: _IntCodes | _DTypeLike[int_] | type[int | ctypes.c_long]) -> type[ctypes.c_long]:
...
@overload
def as_ctypes_type(dtype: _LongLongCodes | _DTypeLike[longlong] | type[ctypes.c_longlong]) -> type[ctypes.c_longlong]:
...
@overload
def as_ctypes_type(dtype: _UByteCodes | _DTypeLike[ubyte] | type[ctypes.c_ubyte]) -> type[ctypes.c_ubyte]:
...
@overload
def as_ctypes_type(dtype: _UShortCodes | _DTypeLike[ushort] | type[ctypes.c_ushort]) -> type[ctypes.c_ushort]:
...
@overload
def as_ctypes_type(dtype: _UIntCCodes | _DTypeLike[uintc] | type[ctypes.c_uint]) -> type[ctypes.c_uint]:
...
@overload
def as_ctypes_type(dtype: _UIntCodes | _DTypeLike[uint] | type[ctypes.c_ulong]) -> type[ctypes.c_ulong]:
...
@overload
def as_ctypes_type(dtype: _ULongLongCodes | _DTypeLike[ulonglong] | type[ctypes.c_ulonglong]) -> type[ctypes.c_ulonglong]:
...
@overload
def as_ctypes_type(dtype: _SingleCodes | _DTypeLike[single] | type[ctypes.c_float]) -> type[ctypes.c_float]:
...
@overload
def as_ctypes_type(dtype: _DoubleCodes | _DTypeLike[double] | type[float | ctypes.c_double]) -> type[ctypes.c_double]:
...
@overload
def as_ctypes_type(dtype: _LongDoubleCodes | _DTypeLike[longdouble] | type[ctypes.c_longdouble]) -> type[ctypes.c_longdouble]:
...
@overload
def as_ctypes_type(dtype: _VoidDTypeLike) -> type[Any]:
...
@overload
def as_ctypes_type(dtype: str) -> type[Any]:
...
@overload
def as_array(obj: ctypes._PointerLike, shape: Sequence[int]) -> NDArray[Any]:
...
@overload
def as_array(obj: _ArrayLike[_SCT], shape: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def as_array(obj: object, shape: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def as_ctypes(obj: bool_) -> ctypes.c_bool:
...
@overload
def as_ctypes(obj: byte) -> ctypes.c_byte:
...
@overload
def as_ctypes(obj: short) -> ctypes.c_short:
...
@overload
def as_ctypes(obj: intc) -> ctypes.c_int:
...
@overload
def as_ctypes(obj: int_) -> ctypes.c_long:
...
@overload
def as_ctypes(obj: longlong) -> ctypes.c_longlong:
...
@overload
def as_ctypes(obj: ubyte) -> ctypes.c_ubyte:
...
@overload
def as_ctypes(obj: ushort) -> ctypes.c_ushort:
...
@overload
def as_ctypes(obj: uintc) -> ctypes.c_uint:
...
@overload
def as_ctypes(obj: uint) -> ctypes.c_ulong:
...
@overload
def as_ctypes(obj: ulonglong) -> ctypes.c_ulonglong:
...
@overload
def as_ctypes(obj: single) -> ctypes.c_float:
...
@overload
def as_ctypes(obj: double) -> ctypes.c_double:
...
@overload
def as_ctypes(obj: longdouble) -> ctypes.c_longdouble:
...
@overload
def as_ctypes(obj: void) -> Any:
...
@overload
def as_ctypes(obj: NDArray[bool_]) -> ctypes.Array[ctypes.c_bool]:
...
@overload
def as_ctypes(obj: NDArray[byte]) -> ctypes.Array[ctypes.c_byte]:
...
@overload
def as_ctypes(obj: NDArray[short]) -> ctypes.Array[ctypes.c_short]:
...
@overload
def as_ctypes(obj: NDArray[intc]) -> ctypes.Array[ctypes.c_int]:
...
@overload
def as_ctypes(obj: NDArray[int_]) -> ctypes.Array[ctypes.c_long]:
...
@overload
def as_ctypes(obj: NDArray[longlong]) -> ctypes.Array[ctypes.c_longlong]:
...
@overload
def as_ctypes(obj: NDArray[ubyte]) -> ctypes.Array[ctypes.c_ubyte]:
...
@overload
def as_ctypes(obj: NDArray[ushort]) -> ctypes.Array[ctypes.c_ushort]:
...
@overload
def as_ctypes(obj: NDArray[uintc]) -> ctypes.Array[ctypes.c_uint]:
...
@overload
def as_ctypes(obj: NDArray[uint]) -> ctypes.Array[ctypes.c_ulong]:
...
@overload
def as_ctypes(obj: NDArray[ulonglong]) -> ctypes.Array[ctypes.c_ulonglong]:
...
@overload
def as_ctypes(obj: NDArray[single]) -> ctypes.Array[ctypes.c_float]:
...
@overload
def as_ctypes(obj: NDArray[double]) -> ctypes.Array[ctypes.c_double]:
...
@overload
def as_ctypes(obj: NDArray[longdouble]) -> ctypes.Array[ctypes.c_longdouble]:
...
@overload
def as_ctypes(obj: NDArray[void]) -> ctypes.Array[Any]:
...

View file

@ -0,0 +1,9 @@
"""
This type stub file was generated by pyright.
"""
import os
ref_dir = ...
__all__ = sorted(f[: -3] for f in os.listdir(ref_dir) if f.endswith('.py') and notf.startswith('__'))
__doc__ = ...

39
typings/numpy/dtypes.pyi Normal file
View file

@ -0,0 +1,39 @@
"""
This type stub file was generated by pyright.
"""
import numpy as np
__all__: list[str]
BoolDType = np.dtype[np.bool_]
Int8DType = np.dtype[np.int8]
UInt8DType = np.dtype[np.uint8]
Int16DType = np.dtype[np.int16]
UInt16DType = np.dtype[np.uint16]
Int32DType = np.dtype[np.int32]
UInt32DType = np.dtype[np.uint32]
Int64DType = np.dtype[np.int64]
UInt64DType = np.dtype[np.uint64]
ByteDType = np.dtype[np.byte]
UByteDType = np.dtype[np.ubyte]
ShortDType = np.dtype[np.short]
UShortDType = np.dtype[np.ushort]
IntDType = np.dtype[np.intc]
UIntDType = np.dtype[np.uintc]
LongDType = np.dtype[np.int_]
ULongDType = np.dtype[np.uint]
LongLongDType = np.dtype[np.longlong]
ULongLongDType = np.dtype[np.ulonglong]
Float16DType = np.dtype[np.float16]
Float32DType = np.dtype[np.float32]
Float64DType = np.dtype[np.float64]
LongDoubleDType = np.dtype[np.longdouble]
Complex64DType = np.dtype[np.complex64]
Complex128DType = np.dtype[np.complex128]
CLongDoubleDType = np.dtype[np.clongdouble]
ObjectDType = np.dtype[np.object_]
BytesDType = np.dtype[np.bytes_]
StrDType = np.dtype[np.str_]
VoidDType = np.dtype[np.void]
DateTime64DType = np.dtype[np.datetime64]
TimeDelta64DType = np.dtype[np.timedelta64]

View file

@ -0,0 +1,43 @@
"""
This type stub file was generated by pyright.
"""
from typing import overload
__all__: list[str]
class ComplexWarning(RuntimeWarning):
...
class ModuleDeprecationWarning(DeprecationWarning):
...
class VisibleDeprecationWarning(UserWarning):
...
class TooHardError(RuntimeError):
...
class DTypePromotionError(TypeError):
...
class AxisError(ValueError, IndexError):
axis: None | int
ndim: None | int
@overload
def __init__(self, axis: str, ndim: None = ..., msg_prefix: None = ...) -> None:
...
@overload
def __init__(self, axis: int, ndim: int, msg_prefix: None | str = ...) -> None:
...
def __str__(self) -> str:
...

View file

@ -0,0 +1,38 @@
"""
This type stub file was generated by pyright.
"""
import os
import subprocess
from collections.abc import Iterable
from typing import Any, Literal as L, TypedDict, overload
from numpy._pytesttester import PytestTester
class _F2PyDictBase(TypedDict):
csrc: list[str]
h: list[str]
...
class _F2PyDict(_F2PyDictBase, total=False):
fsrc: list[str]
ltx: list[str]
...
__all__: list[str]
test: PytestTester
def run_main(comline_list: Iterable[str]) -> dict[str, _F2PyDict]:
...
@overload
def compile(source: str | bytes, modulename: str = ..., extra_args: str | list[str] = ..., verbose: bool = ..., source_fn: None | str | bytes | os.PathLike[Any] = ..., extension: L[".f", ".f90"] = ..., full_output: L[False] = ...) -> int:
...
@overload
def compile(source: str | bytes, modulename: str = ..., extra_args: str | list[str] = ..., verbose: bool = ..., source_fn: None | str | bytes | os.PathLike[Any] = ..., extension: L[".f", ".f90"] = ..., full_output: L[True] = ...) -> subprocess.CompletedProcess[bytes]:
...
def get_include() -> str:
...

View file

@ -0,0 +1,11 @@
"""
This type stub file was generated by pyright.
"""
from numpy._pytesttester import PytestTester
from numpy.fft._pocketfft import fft as fft, fft2 as fft2, fftn as fftn, hfft as hfft, ifft as ifft, ifft2 as ifft2, ifftn as ifftn, ihfft as ihfft, irfft as irfft, irfft2 as irfft2, irfftn as irfftn, rfft as rfft, rfft2 as rfft2, rfftn as rfftn
from numpy.fft.helper import fftfreq as fftfreq, fftshift as fftshift, ifftshift as ifftshift, rfftfreq as rfftfreq
__all__: list[str]
__path__: list[str]
test: PytestTester

View file

@ -0,0 +1,53 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Sequence
from typing import Literal as L
from numpy import complex128, float64
from numpy._typing import ArrayLike, NDArray, _ArrayLikeNumber_co
_NormKind = L[None, "backward", "ortho", "forward"]
__all__: list[str]
def fft(a: ArrayLike, n: None | int = ..., axis: int = ..., norm: _NormKind = ...) -> NDArray[complex128]:
...
def ifft(a: ArrayLike, n: None | int = ..., axis: int = ..., norm: _NormKind = ...) -> NDArray[complex128]:
...
def rfft(a: ArrayLike, n: None | int = ..., axis: int = ..., norm: _NormKind = ...) -> NDArray[complex128]:
...
def irfft(a: ArrayLike, n: None | int = ..., axis: int = ..., norm: _NormKind = ...) -> NDArray[float64]:
...
def hfft(a: _ArrayLikeNumber_co, n: None | int = ..., axis: int = ..., norm: _NormKind = ...) -> NDArray[float64]:
...
def ihfft(a: ArrayLike, n: None | int = ..., axis: int = ..., norm: _NormKind = ...) -> NDArray[complex128]:
...
def fftn(a: ArrayLike, s: None | Sequence[int] = ..., axes: None | Sequence[int] = ..., norm: _NormKind = ...) -> NDArray[complex128]:
...
def ifftn(a: ArrayLike, s: None | Sequence[int] = ..., axes: None | Sequence[int] = ..., norm: _NormKind = ...) -> NDArray[complex128]:
...
def rfftn(a: ArrayLike, s: None | Sequence[int] = ..., axes: None | Sequence[int] = ..., norm: _NormKind = ...) -> NDArray[complex128]:
...
def irfftn(a: ArrayLike, s: None | Sequence[int] = ..., axes: None | Sequence[int] = ..., norm: _NormKind = ...) -> NDArray[float64]:
...
def fft2(a: ArrayLike, s: None | Sequence[int] = ..., axes: None | Sequence[int] = ..., norm: _NormKind = ...) -> NDArray[complex128]:
...
def ifft2(a: ArrayLike, s: None | Sequence[int] = ..., axes: None | Sequence[int] = ..., norm: _NormKind = ...) -> NDArray[complex128]:
...
def rfft2(a: ArrayLike, s: None | Sequence[int] = ..., axes: None | Sequence[int] = ..., norm: _NormKind = ...) -> NDArray[complex128]:
...
def irfft2(a: ArrayLike, s: None | Sequence[int] = ..., axes: None | Sequence[int] = ..., norm: _NormKind = ...) -> NDArray[float64]:
...

View file

@ -0,0 +1,42 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, TypeVar, overload
from numpy import complexfloating, floating, generic, integer
from numpy._typing import ArrayLike, NDArray, _ArrayLike, _ArrayLikeComplex_co, _ArrayLikeFloat_co, _ShapeLike
_SCT = TypeVar("_SCT", bound=generic)
__all__: list[str]
@overload
def fftshift(x: _ArrayLike[_SCT], axes: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def fftshift(x: ArrayLike, axes: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def ifftshift(x: _ArrayLike[_SCT], axes: None | _ShapeLike = ...) -> NDArray[_SCT]:
...
@overload
def ifftshift(x: ArrayLike, axes: None | _ShapeLike = ...) -> NDArray[Any]:
...
@overload
def fftfreq(n: int | integer[Any], d: _ArrayLikeFloat_co = ...) -> NDArray[floating[Any]]:
...
@overload
def fftfreq(n: int | integer[Any], d: _ArrayLikeComplex_co = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def rfftfreq(n: int | integer[Any], d: _ArrayLikeFloat_co = ...) -> NDArray[floating[Any]]:
...
@overload
def rfftfreq(n: int | integer[Any], d: _ArrayLikeComplex_co = ...) -> NDArray[complexfloating[Any, Any]]:
...

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:
...

View file

@ -0,0 +1,14 @@
"""
This type stub file was generated by pyright.
"""
from numpy.linalg.linalg import cholesky as cholesky, cond as cond, det as det, eig as eig, eigh as eigh, eigvals as eigvals, eigvalsh as eigvalsh, inv as inv, lstsq as lstsq, matrix_power as matrix_power, matrix_rank as matrix_rank, multi_dot as multi_dot, norm as norm, pinv as pinv, qr as qr, slogdet as slogdet, solve as solve, svd as svd, tensorinv as tensorinv, tensorsolve as tensorsolve
from numpy._pytesttester import PytestTester
__all__: list[str]
__path__: list[str]
test: PytestTester
class LinAlgError(Exception):
...

View file

@ -0,0 +1,233 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Iterable
from typing import Any, Literal as L, NamedTuple, SupportsIndex, SupportsInt, TypeVar, overload
from numpy import complex128, complexfloating, float64, floating, generic, int32
from numpy._typing import ArrayLike, NDArray, _ArrayLikeComplex_co, _ArrayLikeFloat_co, _ArrayLikeInt_co, _ArrayLikeObject_co, _ArrayLikeTD64_co
_T = TypeVar("_T")
_ArrayType = TypeVar("_ArrayType", bound=NDArray[Any])
_SCT = TypeVar("_SCT", bound=generic, covariant=True)
_SCT2 = TypeVar("_SCT2", bound=generic, covariant=True)
_2Tuple = tuple[_T, _T]
_ModeKind = L["reduced", "complete", "r", "raw"]
__all__: list[str]
class EigResult(NamedTuple):
eigenvalues: NDArray[Any]
eigenvectors: NDArray[Any]
...
class EighResult(NamedTuple):
eigenvalues: NDArray[Any]
eigenvectors: NDArray[Any]
...
class QRResult(NamedTuple):
Q: NDArray[Any]
R: NDArray[Any]
...
class SlogdetResult(NamedTuple):
sign: Any
logabsdet: Any
...
class SVDResult(NamedTuple):
U: NDArray[Any]
S: NDArray[Any]
Vh: NDArray[Any]
...
@overload
def tensorsolve(a: _ArrayLikeInt_co, b: _ArrayLikeInt_co, axes: None | Iterable[int] = ...) -> NDArray[float64]:
...
@overload
def tensorsolve(a: _ArrayLikeFloat_co, b: _ArrayLikeFloat_co, axes: None | Iterable[int] = ...) -> NDArray[floating[Any]]:
...
@overload
def tensorsolve(a: _ArrayLikeComplex_co, b: _ArrayLikeComplex_co, axes: None | Iterable[int] = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def solve(a: _ArrayLikeInt_co, b: _ArrayLikeInt_co) -> NDArray[float64]:
...
@overload
def solve(a: _ArrayLikeFloat_co, b: _ArrayLikeFloat_co) -> NDArray[floating[Any]]:
...
@overload
def solve(a: _ArrayLikeComplex_co, b: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def tensorinv(a: _ArrayLikeInt_co, ind: int = ...) -> NDArray[float64]:
...
@overload
def tensorinv(a: _ArrayLikeFloat_co, ind: int = ...) -> NDArray[floating[Any]]:
...
@overload
def tensorinv(a: _ArrayLikeComplex_co, ind: int = ...) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def inv(a: _ArrayLikeInt_co) -> NDArray[float64]:
...
@overload
def inv(a: _ArrayLikeFloat_co) -> NDArray[floating[Any]]:
...
@overload
def inv(a: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
def matrix_power(a: _ArrayLikeComplex_co | _ArrayLikeObject_co, n: SupportsIndex) -> NDArray[Any]:
...
@overload
def cholesky(a: _ArrayLikeInt_co) -> NDArray[float64]:
...
@overload
def cholesky(a: _ArrayLikeFloat_co) -> NDArray[floating[Any]]:
...
@overload
def cholesky(a: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def qr(a: _ArrayLikeInt_co, mode: _ModeKind = ...) -> QRResult:
...
@overload
def qr(a: _ArrayLikeFloat_co, mode: _ModeKind = ...) -> QRResult:
...
@overload
def qr(a: _ArrayLikeComplex_co, mode: _ModeKind = ...) -> QRResult:
...
@overload
def eigvals(a: _ArrayLikeInt_co) -> NDArray[float64] | NDArray[complex128]:
...
@overload
def eigvals(a: _ArrayLikeFloat_co) -> NDArray[floating[Any]] | NDArray[complexfloating[Any, Any]]:
...
@overload
def eigvals(a: _ArrayLikeComplex_co) -> NDArray[complexfloating[Any, Any]]:
...
@overload
def eigvalsh(a: _ArrayLikeInt_co, UPLO: L["L", "U", "l", "u"] = ...) -> NDArray[float64]:
...
@overload
def eigvalsh(a: _ArrayLikeComplex_co, UPLO: L["L", "U", "l", "u"] = ...) -> NDArray[floating[Any]]:
...
@overload
def eig(a: _ArrayLikeInt_co) -> EigResult:
...
@overload
def eig(a: _ArrayLikeFloat_co) -> EigResult:
...
@overload
def eig(a: _ArrayLikeComplex_co) -> EigResult:
...
@overload
def eigh(a: _ArrayLikeInt_co, UPLO: L["L", "U", "l", "u"] = ...) -> EighResult:
...
@overload
def eigh(a: _ArrayLikeFloat_co, UPLO: L["L", "U", "l", "u"] = ...) -> EighResult:
...
@overload
def eigh(a: _ArrayLikeComplex_co, UPLO: L["L", "U", "l", "u"] = ...) -> EighResult:
...
@overload
def svd(a: _ArrayLikeInt_co, full_matrices: bool = ..., compute_uv: L[True] = ..., hermitian: bool = ...) -> SVDResult:
...
@overload
def svd(a: _ArrayLikeFloat_co, full_matrices: bool = ..., compute_uv: L[True] = ..., hermitian: bool = ...) -> SVDResult:
...
@overload
def svd(a: _ArrayLikeComplex_co, full_matrices: bool = ..., compute_uv: L[True] = ..., hermitian: bool = ...) -> SVDResult:
...
@overload
def svd(a: _ArrayLikeInt_co, full_matrices: bool = ..., compute_uv: L[False] = ..., hermitian: bool = ...) -> NDArray[float64]:
...
@overload
def svd(a: _ArrayLikeComplex_co, full_matrices: bool = ..., compute_uv: L[False] = ..., hermitian: bool = ...) -> NDArray[floating[Any]]:
...
def cond(x: _ArrayLikeComplex_co, p: None | float | L["fro", "nuc"] = ...) -> Any:
...
def matrix_rank(A: _ArrayLikeComplex_co, tol: None | _ArrayLikeFloat_co = ..., hermitian: bool = ...) -> Any:
...
@overload
def pinv(a: _ArrayLikeInt_co, rcond: _ArrayLikeFloat_co = ..., hermitian: bool = ...) -> NDArray[float64]:
...
@overload
def pinv(a: _ArrayLikeFloat_co, rcond: _ArrayLikeFloat_co = ..., hermitian: bool = ...) -> NDArray[floating[Any]]:
...
@overload
def pinv(a: _ArrayLikeComplex_co, rcond: _ArrayLikeFloat_co = ..., hermitian: bool = ...) -> NDArray[complexfloating[Any, Any]]:
...
def slogdet(a: _ArrayLikeComplex_co) -> SlogdetResult:
...
def det(a: _ArrayLikeComplex_co) -> Any:
...
@overload
def lstsq(a: _ArrayLikeInt_co, b: _ArrayLikeInt_co, rcond: None | float = ...) -> tuple[NDArray[float64], NDArray[float64], int32, NDArray[float64],]:
...
@overload
def lstsq(a: _ArrayLikeFloat_co, b: _ArrayLikeFloat_co, rcond: None | float = ...) -> tuple[NDArray[floating[Any]], NDArray[floating[Any]], int32, NDArray[floating[Any]],]:
...
@overload
def lstsq(a: _ArrayLikeComplex_co, b: _ArrayLikeComplex_co, rcond: None | float = ...) -> tuple[NDArray[complexfloating[Any, Any]], NDArray[floating[Any]], int32, NDArray[floating[Any]],]:
...
@overload
def norm(x: ArrayLike, ord: None | float | L["fro", "nuc"] = ..., axis: None = ..., keepdims: bool = ...) -> floating[Any]:
...
@overload
def norm(x: ArrayLike, ord: None | float | L["fro", "nuc"] = ..., axis: SupportsInt | SupportsIndex | tuple[int, ...] = ..., keepdims: bool = ...) -> Any:
...
def multi_dot(arrays: Iterable[_ArrayLikeComplex_co | _ArrayLikeObject_co | _ArrayLikeTD64_co], *, out: None | NDArray[Any] = ...) -> Any:
...

View file

@ -0,0 +1,12 @@
"""
This type stub file was generated by pyright.
"""
from numpy._pytesttester import PytestTester
from numpy.ma import extras as extras
from numpy.ma.core import MAError as MAError, MaskError as MaskError, MaskType as MaskType, MaskedArray as MaskedArray, abs as abs, absolute as absolute, add as add, all as all, allclose as allclose, allequal as allequal, alltrue as alltrue, amax as amax, amin as amin, angle as angle, anom as anom, anomalies as anomalies, any as any, append as append, arange as arange, arccos as arccos, arccosh as arccosh, arcsin as arcsin, arcsinh as arcsinh, arctan as arctan, arctan2 as arctan2, arctanh as arctanh, argmax as argmax, argmin as argmin, argsort as argsort, around as around, array as array, asanyarray as asanyarray, asarray as asarray, bitwise_and as bitwise_and, bitwise_or as bitwise_or, bitwise_xor as bitwise_xor, bool_ as bool_, ceil as ceil, choose as choose, clip as clip, common_fill_value as common_fill_value, compress as compress, compressed as compressed, concatenate as concatenate, conjugate as conjugate, convolve as convolve, copy as copy, correlate as correlate, cos as cos, cosh as cosh, count as count, cumprod as cumprod, cumsum as cumsum, default_fill_value as default_fill_value, diag as diag, diagonal as diagonal, diff as diff, divide as divide, empty as empty, empty_like as empty_like, equal as equal, exp as exp, expand_dims as expand_dims, fabs as fabs, filled as filled, fix_invalid as fix_invalid, flatten_mask as flatten_mask, flatten_structured_array as flatten_structured_array, floor as floor, floor_divide as floor_divide, fmod as fmod, frombuffer as frombuffer, fromflex as fromflex, fromfunction as fromfunction, getdata as getdata, getmask as getmask, getmaskarray as getmaskarray, greater as greater, greater_equal as greater_equal, harden_mask as harden_mask, hypot as hypot, identity as identity, ids as ids, indices as indices, inner as inner, innerproduct as innerproduct, isMA as isMA, isMaskedArray as isMaskedArray, is_mask as is_mask, is_masked as is_masked, isarray as isarray, left_shift as left_shift, less as less, less_equal as less_equal, log as log, log10 as log10, log2 as log2, logical_and as logical_and, logical_not as logical_not, logical_or as logical_or, logical_xor as logical_xor, make_mask as make_mask, make_mask_descr as make_mask_descr, make_mask_none as make_mask_none, mask_or as mask_or, masked as masked, masked_array as masked_array, masked_equal as masked_equal, masked_greater as masked_greater, masked_greater_equal as masked_greater_equal, masked_inside as masked_inside, masked_invalid as masked_invalid, masked_less as masked_less, masked_less_equal as masked_less_equal, masked_not_equal as masked_not_equal, masked_object as masked_object, masked_outside as masked_outside, masked_print_option as masked_print_option, masked_singleton as masked_singleton, masked_values as masked_values, masked_where as masked_where, max as max, maximum as maximum, maximum_fill_value as maximum_fill_value, mean as mean, min as min, minimum as minimum, minimum_fill_value as minimum_fill_value, mod as mod, multiply as multiply, mvoid as mvoid, ndim as ndim, negative as negative, nomask as nomask, nonzero as nonzero, not_equal as not_equal, ones as ones, outer as outer, outerproduct as outerproduct, power as power, prod as prod, product as product, ptp as ptp, put as put, putmask as putmask, ravel as ravel, remainder as remainder, repeat as repeat, reshape as reshape, resize as resize, right_shift as right_shift, round as round, set_fill_value as set_fill_value, shape as shape, sin as sin, sinh as sinh, size as size, soften_mask as soften_mask, sometrue as sometrue, sort as sort, sqrt as sqrt, squeeze as squeeze, std as std, subtract as subtract, sum as sum, swapaxes as swapaxes, take as take, tan as tan, tanh as tanh, trace as trace, transpose as transpose, true_divide as true_divide, var as var, where as where, zeros as zeros
from numpy.ma.extras import apply_along_axis as apply_along_axis, apply_over_axes as apply_over_axes, atleast_1d as atleast_1d, atleast_2d as atleast_2d, atleast_3d as atleast_3d, average as average, clump_masked as clump_masked, clump_unmasked as clump_unmasked, column_stack as column_stack, compress_cols as compress_cols, compress_nd as compress_nd, compress_rowcols as compress_rowcols, compress_rows as compress_rows, corrcoef as corrcoef, count_masked as count_masked, cov as cov, diagflat as diagflat, dot as dot, dstack as dstack, ediff1d as ediff1d, flatnotmasked_contiguous as flatnotmasked_contiguous, flatnotmasked_edges as flatnotmasked_edges, hsplit as hsplit, hstack as hstack, in1d as in1d, intersect1d as intersect1d, isin as isin, mask_cols as mask_cols, mask_rowcols as mask_rowcols, mask_rows as mask_rows, masked_all as masked_all, masked_all_like as masked_all_like, median as median, mr_ as mr_, ndenumerate as ndenumerate, notmasked_contiguous as notmasked_contiguous, notmasked_edges as notmasked_edges, polyfit as polyfit, row_stack as row_stack, setdiff1d as setdiff1d, setxor1d as setxor1d, stack as stack, union1d as union1d, unique as unique, vander as vander, vstack as vstack
__all__: list[str]
__path__: list[str]
test: PytestTester

853
typings/numpy/ma/core.pyi Normal file
View file

@ -0,0 +1,853 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Callable
from typing import Any, TypeVar
from numpy import bool_ as bool_, dtype, float64, ndarray, squeeze as squeeze
_ShapeType = TypeVar("_ShapeType", bound=Any)
_DType_co = TypeVar("_DType_co", bound=dtype[Any], covariant=True)
__all__: list[str]
MaskType = bool_
nomask: bool_
class MaskedArrayFutureWarning(FutureWarning):
...
class MAError(Exception):
...
class MaskError(MAError):
...
def default_fill_value(obj):
...
def minimum_fill_value(obj):
...
def maximum_fill_value(obj):
...
def set_fill_value(a, fill_value):
...
def common_fill_value(a, b):
...
def filled(a, fill_value=...):
...
def getdata(a, subok=...):
...
get_data = ...
def fix_invalid(a, mask=..., copy=..., fill_value=...):
...
class _MaskedUFunc:
f: Any
__doc__: Any
__name__: Any
def __init__(self, ufunc) -> None:
...
class _MaskedUnaryOperation(_MaskedUFunc):
fill: Any
domain: Any
def __init__(self, mufunc, fill=..., domain=...) -> None:
...
def __call__(self, a, *args, **kwargs):
...
class _MaskedBinaryOperation(_MaskedUFunc):
fillx: Any
filly: Any
def __init__(self, mbfunc, fillx=..., filly=...) -> None:
...
def __call__(self, a, b, *args, **kwargs):
...
def reduce(self, target, axis=..., dtype=...):
...
def outer(self, a, b):
...
def accumulate(self, target, axis=...):
...
class _DomainedBinaryOperation(_MaskedUFunc):
domain: Any
fillx: Any
filly: Any
def __init__(self, dbfunc, domain, fillx=..., filly=...) -> None:
...
def __call__(self, a, b, *args, **kwargs):
...
exp: _MaskedUnaryOperation
conjugate: _MaskedUnaryOperation
sin: _MaskedUnaryOperation
cos: _MaskedUnaryOperation
arctan: _MaskedUnaryOperation
arcsinh: _MaskedUnaryOperation
sinh: _MaskedUnaryOperation
cosh: _MaskedUnaryOperation
tanh: _MaskedUnaryOperation
abs: _MaskedUnaryOperation
absolute: _MaskedUnaryOperation
fabs: _MaskedUnaryOperation
negative: _MaskedUnaryOperation
floor: _MaskedUnaryOperation
ceil: _MaskedUnaryOperation
around: _MaskedUnaryOperation
logical_not: _MaskedUnaryOperation
sqrt: _MaskedUnaryOperation
log: _MaskedUnaryOperation
log2: _MaskedUnaryOperation
log10: _MaskedUnaryOperation
tan: _MaskedUnaryOperation
arcsin: _MaskedUnaryOperation
arccos: _MaskedUnaryOperation
arccosh: _MaskedUnaryOperation
arctanh: _MaskedUnaryOperation
add: _MaskedBinaryOperation
subtract: _MaskedBinaryOperation
multiply: _MaskedBinaryOperation
arctan2: _MaskedBinaryOperation
equal: _MaskedBinaryOperation
not_equal: _MaskedBinaryOperation
less_equal: _MaskedBinaryOperation
greater_equal: _MaskedBinaryOperation
less: _MaskedBinaryOperation
greater: _MaskedBinaryOperation
logical_and: _MaskedBinaryOperation
alltrue: _MaskedBinaryOperation
logical_or: _MaskedBinaryOperation
sometrue: Callable[..., Any]
logical_xor: _MaskedBinaryOperation
bitwise_and: _MaskedBinaryOperation
bitwise_or: _MaskedBinaryOperation
bitwise_xor: _MaskedBinaryOperation
hypot: _MaskedBinaryOperation
divide: _MaskedBinaryOperation
true_divide: _MaskedBinaryOperation
floor_divide: _MaskedBinaryOperation
remainder: _MaskedBinaryOperation
fmod: _MaskedBinaryOperation
mod: _MaskedBinaryOperation
def make_mask_descr(ndtype):
...
def getmask(a):
...
get_mask = ...
def getmaskarray(arr):
...
def is_mask(m):
...
def make_mask(m, copy=..., shrink=..., dtype=...):
...
def make_mask_none(newshape, dtype=...):
...
def mask_or(m1, m2, copy=..., shrink=...):
...
def flatten_mask(mask):
...
def masked_where(condition, a, copy=...):
...
def masked_greater(x, value, copy=...):
...
def masked_greater_equal(x, value, copy=...):
...
def masked_less(x, value, copy=...):
...
def masked_less_equal(x, value, copy=...):
...
def masked_not_equal(x, value, copy=...):
...
def masked_equal(x, value, copy=...):
...
def masked_inside(x, v1, v2, copy=...):
...
def masked_outside(x, v1, v2, copy=...):
...
def masked_object(x, value, copy=..., shrink=...):
...
def masked_values(x, value, rtol=..., atol=..., copy=..., shrink=...):
...
def masked_invalid(a, copy=...):
...
class _MaskedPrintOption:
def __init__(self, display) -> None:
...
def display(self):
...
def set_display(self, s):
...
def enabled(self):
...
def enable(self, shrink=...):
...
masked_print_option: _MaskedPrintOption
def flatten_structured_array(a):
...
class MaskedIterator:
ma: Any
dataiter: Any
maskiter: Any
def __init__(self, ma) -> None:
...
def __iter__(self):
...
def __getitem__(self, indx):
...
def __setitem__(self, index, value):
...
def __next__(self):
...
class MaskedArray(ndarray[_ShapeType, _DType_co]):
__array_priority__: Any
def __new__(cls, data=..., mask=..., dtype=..., copy=..., subok=..., ndmin=..., fill_value=..., keep_mask=..., hard_mask=..., shrink=..., order=...):
...
def __array_finalize__(self, obj):
...
def __array_wrap__(self, obj, context=...):
...
def view(self, dtype=..., type=..., fill_value=...):
...
def __getitem__(self, indx):
...
def __setitem__(self, indx, value):
...
@property
def dtype(self):
...
@dtype.setter
def dtype(self, dtype):
...
@property
def shape(self):
...
@shape.setter
def shape(self, shape):
...
def __setmask__(self, mask, copy=...):
...
@property
def mask(self):
...
@mask.setter
def mask(self, value):
...
@property
def recordmask(self):
...
@recordmask.setter
def recordmask(self, mask):
...
def harden_mask(self):
...
def soften_mask(self):
...
@property
def hardmask(self):
...
def unshare_mask(self):
...
@property
def sharedmask(self):
...
def shrink_mask(self):
...
@property
def baseclass(self):
...
data: Any
@property
def flat(self):
...
@flat.setter
def flat(self, value):
...
@property
def fill_value(self):
...
@fill_value.setter
def fill_value(self, value=...):
...
get_fill_value: Any
set_fill_value: Any
def filled(self, fill_value=...):
...
def compressed(self):
...
def compress(self, condition, axis=..., out=...):
...
def __eq__(self, other) -> bool:
...
def __ne__(self, other) -> bool:
...
def __ge__(self, other) -> bool:
...
def __gt__(self, other) -> bool:
...
def __le__(self, other) -> bool:
...
def __lt__(self, other) -> bool:
...
def __add__(self, other):
...
def __radd__(self, other):
...
def __sub__(self, other):
...
def __rsub__(self, other):
...
def __mul__(self, other):
...
def __rmul__(self, other):
...
def __div__(self, other):
...
def __truediv__(self, other):
...
def __rtruediv__(self, other):
...
def __floordiv__(self, other):
...
def __rfloordiv__(self, other):
...
def __pow__(self, other):
...
def __rpow__(self, other):
...
def __iadd__(self, other):
...
def __isub__(self, other):
...
def __imul__(self, other):
...
def __idiv__(self, other):
...
def __ifloordiv__(self, other):
...
def __itruediv__(self, other):
...
def __ipow__(self, other):
...
def __float__(self):
...
def __int__(self) -> int:
...
@property
def imag(self):
...
get_imag: Any
@property
def real(self):
...
get_real: Any
def count(self, axis=..., keepdims=...):
...
def ravel(self, order=...):
...
def reshape(self, *s, **kwargs):
...
def resize(self, newshape, refcheck=..., order=...):
...
def put(self, indices, values, mode=...):
...
def ids(self):
...
def iscontiguous(self):
...
def all(self, axis=..., out=..., keepdims=...):
...
def any(self, axis=..., out=..., keepdims=...):
...
def nonzero(self):
...
def trace(self, offset=..., axis1=..., axis2=..., dtype=..., out=...):
...
def dot(self, b, out=..., strict=...):
...
def sum(self, axis=..., dtype=..., out=..., keepdims=...):
...
def cumsum(self, axis=..., dtype=..., out=...):
...
def prod(self, axis=..., dtype=..., out=..., keepdims=...):
...
product: Any
def cumprod(self, axis=..., dtype=..., out=...):
...
def mean(self, axis=..., dtype=..., out=..., keepdims=...):
...
def anom(self, axis=..., dtype=...):
...
def var(self, axis=..., dtype=..., out=..., ddof=..., keepdims=...):
...
def std(self, axis=..., dtype=..., out=..., ddof=..., keepdims=...):
...
def round(self, decimals=..., out=...):
...
def argsort(self, axis=..., kind=..., order=..., endwith=..., fill_value=...):
...
def argmin(self, axis=..., fill_value=..., out=..., *, keepdims=...):
...
def argmax(self, axis=..., fill_value=..., out=..., *, keepdims=...):
...
def sort(self, axis=..., kind=..., order=..., endwith=..., fill_value=...):
...
def min(self, axis=..., out=..., fill_value=..., keepdims=...):
...
def max(self, axis=..., out=..., fill_value=..., keepdims=...):
...
def ptp(self, axis=..., out=..., fill_value=..., keepdims=...):
...
def partition(self, *args, **kwargs):
...
def argpartition(self, *args, **kwargs):
...
def take(self, indices, axis=..., out=..., mode=...):
...
copy: Any
diagonal: Any
flatten: Any
repeat: Any
squeeze: Any
swapaxes: Any
T: Any
transpose: Any
def tolist(self, fill_value=...):
...
def tobytes(self, fill_value=..., order=...):
...
def tofile(self, fid, sep=..., format=...):
...
def toflex(self):
...
torecords: Any
def __reduce__(self):
...
def __deepcopy__(self, memo=...):
...
class mvoid(MaskedArray[_ShapeType, _DType_co]):
def __new__(self, data, mask=..., dtype=..., fill_value=..., hardmask=..., copy=..., subok=...):
...
def __getitem__(self, indx):
...
def __setitem__(self, indx, value):
...
def __iter__(self):
...
def __len__(self):
...
def filled(self, fill_value=...):
...
def tolist(self):
...
def isMaskedArray(x):
...
isarray = ...
isMA = ...
class MaskedConstant(MaskedArray[Any, dtype[float64]]):
def __new__(cls):
...
__class__: Any
def __array_finalize__(self, obj):
...
def __array_prepare__(self, obj, context=...):
...
def __array_wrap__(self, obj, context=...):
...
def __format__(self, format_spec):
...
def __reduce__(self):
...
def __iop__(self, other):
...
__iadd__: Any
__isub__: Any
__imul__: Any
__ifloordiv__: Any
__itruediv__: Any
__ipow__: Any
def copy(self, *args, **kwargs):
...
def __copy__(self):
...
def __deepcopy__(self, memo):
...
def __setattr__(self, attr, value):
...
masked: MaskedConstant
masked_singleton: MaskedConstant
masked_array = MaskedArray
def array(data, dtype=..., copy=..., order=..., mask=..., fill_value=..., keep_mask=..., hard_mask=..., shrink=..., subok=..., ndmin=...):
...
def is_masked(x):
...
class _extrema_operation(_MaskedUFunc):
compare: Any
fill_value_func: Any
def __init__(self, ufunc, compare, fill_value) -> None:
...
def __call__(self, a, b):
...
def reduce(self, target, axis=...):
...
def outer(self, a, b):
...
def min(obj, axis=..., out=..., fill_value=..., keepdims=...):
...
def max(obj, axis=..., out=..., fill_value=..., keepdims=...):
...
def ptp(obj, axis=..., out=..., fill_value=..., keepdims=...):
...
class _frommethod:
__name__: Any
__doc__: Any
reversed: Any
def __init__(self, methodname, reversed=...) -> None:
...
def getdoc(self):
...
def __call__(self, a, *args, **params):
...
all: _frommethod
anomalies: _frommethod
anom: _frommethod
any: _frommethod
compress: _frommethod
cumprod: _frommethod
cumsum: _frommethod
copy: _frommethod
diagonal: _frommethod
harden_mask: _frommethod
ids: _frommethod
mean: _frommethod
nonzero: _frommethod
prod: _frommethod
product: _frommethod
ravel: _frommethod
repeat: _frommethod
soften_mask: _frommethod
std: _frommethod
sum: _frommethod
swapaxes: _frommethod
trace: _frommethod
var: _frommethod
count: _frommethod
argmin: _frommethod
argmax: _frommethod
minimum: _extrema_operation
maximum: _extrema_operation
def take(a, indices, axis=..., out=..., mode=...):
...
def power(a, b, third=...):
...
def argsort(a, axis=..., kind=..., order=..., endwith=..., fill_value=...):
...
def sort(a, axis=..., kind=..., order=..., endwith=..., fill_value=...):
...
def compressed(x):
...
def concatenate(arrays, axis=...):
...
def diag(v, k=...):
...
def left_shift(a, n):
...
def right_shift(a, n):
...
def put(a, indices, values, mode=...):
...
def putmask(a, mask, values):
...
def transpose(a, axes=...):
...
def reshape(a, new_shape, order=...):
...
def resize(x, new_shape):
...
def ndim(obj):
...
def shape(obj):
...
def size(obj, axis=...):
...
def diff(a, /, n=..., axis=..., prepend=..., append=...):
...
def where(condition, x=..., y=...):
...
def choose(indices, choices, out=..., mode=...):
...
def round(a, decimals=..., out=...):
...
def inner(a, b):
...
innerproduct = ...
def outer(a, b):
...
outerproduct = ...
def correlate(a, v, mode=..., propagate_mask=...):
...
def convolve(a, v, mode=..., propagate_mask=...):
...
def allequal(a, b, fill_value=...):
...
def allclose(a, b, masked_equal=..., rtol=..., atol=...):
...
def asarray(a, dtype=..., order=...):
...
def asanyarray(a, dtype=...):
...
def fromflex(fxarray):
...
class _convert2ma:
__doc__: Any
def __init__(self, funcname, params=...) -> None:
...
def getdoc(self):
...
def __call__(self, *args, **params):
...
arange: _convert2ma
empty: _convert2ma
empty_like: _convert2ma
frombuffer: _convert2ma
fromfunction: _convert2ma
identity: _convert2ma
ones: _convert2ma
zeros: _convert2ma
def append(a, b, axis=...):
...
def dot(a, b, strict=..., out=...):
...
def mask_rowcols(a, axis=...):
...

165
typings/numpy/ma/extras.pyi Normal file
View file

@ -0,0 +1,165 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any
from numpy.lib.index_tricks import AxisConcatenator
__all__: list[str]
def count_masked(arr, axis=...):
...
def masked_all(shape, dtype=...):
...
def masked_all_like(arr):
...
class _fromnxfunction:
__name__: Any
__doc__: Any
def __init__(self, funcname) -> None:
...
def getdoc(self):
...
def __call__(self, *args, **params):
...
class _fromnxfunction_single(_fromnxfunction):
def __call__(self, x, *args, **params):
...
class _fromnxfunction_seq(_fromnxfunction):
def __call__(self, x, *args, **params):
...
class _fromnxfunction_allargs(_fromnxfunction):
def __call__(self, *args, **params):
...
atleast_1d: _fromnxfunction_allargs
atleast_2d: _fromnxfunction_allargs
atleast_3d: _fromnxfunction_allargs
vstack: _fromnxfunction_seq
row_stack: _fromnxfunction_seq
hstack: _fromnxfunction_seq
column_stack: _fromnxfunction_seq
dstack: _fromnxfunction_seq
stack: _fromnxfunction_seq
hsplit: _fromnxfunction_single
diagflat: _fromnxfunction_single
def apply_along_axis(func1d, axis, arr, *args, **kwargs):
...
def apply_over_axes(func, a, axes):
...
def average(a, axis=..., weights=..., returned=..., keepdims=...):
...
def median(a, axis=..., out=..., overwrite_input=..., keepdims=...):
...
def compress_nd(x, axis=...):
...
def compress_rowcols(x, axis=...):
...
def compress_rows(a):
...
def compress_cols(a):
...
def mask_rows(a, axis=...):
...
def mask_cols(a, axis=...):
...
def ediff1d(arr, to_end=..., to_begin=...):
...
def unique(ar1, return_index=..., return_inverse=...):
...
def intersect1d(ar1, ar2, assume_unique=...):
...
def setxor1d(ar1, ar2, assume_unique=...):
...
def in1d(ar1, ar2, assume_unique=..., invert=...):
...
def isin(element, test_elements, assume_unique=..., invert=...):
...
def union1d(ar1, ar2):
...
def setdiff1d(ar1, ar2, assume_unique=...):
...
def cov(x, y=..., rowvar=..., bias=..., allow_masked=..., ddof=...):
...
def corrcoef(x, y=..., rowvar=..., bias=..., allow_masked=..., ddof=...):
...
class MAxisConcatenator(AxisConcatenator):
concatenate: Any
@classmethod
def makemat(cls, arr):
...
def __getitem__(self, key):
...
class mr_class(MAxisConcatenator):
def __init__(self) -> None:
...
mr_: mr_class
def ndenumerate(a, compressed=...):
...
def flatnotmasked_edges(a):
...
def notmasked_edges(a, axis=...):
...
def flatnotmasked_contiguous(a):
...
def notmasked_contiguous(a, axis=...):
...
def clump_unmasked(a):
...
def clump_masked(a):
...
def vander(x, n=...):
...
def polyfit(x, y, deg, rcond=..., full=..., w=..., cov=...):
...

View file

@ -0,0 +1,68 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any, TypeVar
from numpy import dtype
from numpy.ma import MaskedArray
__all__: list[str]
_ShapeType = TypeVar("_ShapeType", bound=Any)
_DType_co = TypeVar("_DType_co", bound=dtype[Any], covariant=True)
class MaskedRecords(MaskedArray[_ShapeType, _DType_co]):
def __new__(cls, shape, dtype=..., buf=..., offset=..., strides=..., formats=..., names=..., titles=..., byteorder=..., aligned=..., mask=..., hard_mask=..., fill_value=..., keep_mask=..., copy=..., **options):
...
_mask: Any
_fill_value: Any
def __array_finalize__(self, obj):
...
def __len__(self):
...
def __getattribute__(self, attr):
...
def __setattr__(self, attr, val):
...
def __getitem__(self, indx):
...
def __setitem__(self, indx, value):
...
def view(self, dtype=..., type=...):
...
def harden_mask(self):
...
def soften_mask(self):
...
def copy(self):
...
def tolist(self, fill_value=...):
...
def __reduce__(self):
...
mrecarray = MaskedRecords
def fromarrays(arraylist, dtype=..., shape=..., formats=..., names=..., titles=..., aligned=..., byteorder=..., fill_value=...):
...
def fromrecords(reclist, dtype=..., shape=..., formats=..., names=..., titles=..., aligned=..., byteorder=..., fill_value=..., mask=...):
...
def fromtextfile(fname, delimiter=..., commentchar=..., missingchar=..., varnames=..., vartypes=...):
...
def addfield(mrecord, newfield, newfieldname=...):
...

344
typings/numpy/matlib.pyi Normal file
View file

@ -0,0 +1,344 @@
"""
This type stub file was generated by pyright.
"""
import numpy as np
from numpy import *
__version__ = ...
__all__ = np.__all__[:]
__all__ += ['rand', 'randn', 'repmat']
def empty(shape, dtype=..., order=...): # -> matrix[Unknown, Unknown]:
"""Return a new matrix of given shape and type, without initializing entries.
Parameters
----------
shape : int or tuple of int
Shape of the empty matrix.
dtype : data-type, optional
Desired output data-type.
order : {'C', 'F'}, optional
Whether to store multi-dimensional data in row-major
(C-style) or column-major (Fortran-style) order in
memory.
See Also
--------
empty_like, zeros
Notes
-----
`empty`, unlike `zeros`, does not set the matrix values to zero,
and may therefore be marginally faster. On the other hand, it requires
the user to manually set all the values in the array, and should be
used with caution.
Examples
--------
>>> import numpy.matlib
>>> np.matlib.empty((2, 2)) # filled with random data
matrix([[ 6.76425276e-320, 9.79033856e-307], # random
[ 7.39337286e-309, 3.22135945e-309]])
>>> np.matlib.empty((2, 2), dtype=int)
matrix([[ 6600475, 0], # random
[ 6586976, 22740995]])
"""
...
def ones(shape, dtype=..., order=...): # -> matrix[Unknown, Unknown]:
"""
Matrix of ones.
Return a matrix of given shape and type, filled with ones.
Parameters
----------
shape : {sequence of ints, int}
Shape of the matrix
dtype : data-type, optional
The desired data-type for the matrix, default is np.float64.
order : {'C', 'F'}, optional
Whether to store matrix in C- or Fortran-contiguous order,
default is 'C'.
Returns
-------
out : matrix
Matrix of ones of given shape, dtype, and order.
See Also
--------
ones : Array of ones.
matlib.zeros : Zero matrix.
Notes
-----
If `shape` has length one i.e. ``(N,)``, or is a scalar ``N``,
`out` becomes a single row matrix of shape ``(1,N)``.
Examples
--------
>>> np.matlib.ones((2,3))
matrix([[1., 1., 1.],
[1., 1., 1.]])
>>> np.matlib.ones(2)
matrix([[1., 1.]])
"""
...
def zeros(shape, dtype=..., order=...): # -> matrix[Unknown, Unknown]:
"""
Return a matrix of given shape and type, filled with zeros.
Parameters
----------
shape : int or sequence of ints
Shape of the matrix
dtype : data-type, optional
The desired data-type for the matrix, default is float.
order : {'C', 'F'}, optional
Whether to store the result in C- or Fortran-contiguous order,
default is 'C'.
Returns
-------
out : matrix
Zero matrix of given shape, dtype, and order.
See Also
--------
numpy.zeros : Equivalent array function.
matlib.ones : Return a matrix of ones.
Notes
-----
If `shape` has length one i.e. ``(N,)``, or is a scalar ``N``,
`out` becomes a single row matrix of shape ``(1,N)``.
Examples
--------
>>> import numpy.matlib
>>> np.matlib.zeros((2, 3))
matrix([[0., 0., 0.],
[0., 0., 0.]])
>>> np.matlib.zeros(2)
matrix([[0., 0.]])
"""
...
def identity(n, dtype=...): # -> matrix[Unknown, Unknown]:
"""
Returns the square identity matrix of given size.
Parameters
----------
n : int
Size of the returned identity matrix.
dtype : data-type, optional
Data-type of the output. Defaults to ``float``.
Returns
-------
out : matrix
`n` x `n` matrix with its main diagonal set to one,
and all other elements zero.
See Also
--------
numpy.identity : Equivalent array function.
matlib.eye : More general matrix identity function.
Examples
--------
>>> import numpy.matlib
>>> np.matlib.identity(3, dtype=int)
matrix([[1, 0, 0],
[0, 1, 0],
[0, 0, 1]])
"""
...
def eye(n, M=..., k=..., dtype=..., order=...): # -> matrix[Any, Any]:
"""
Return a matrix with ones on the diagonal and zeros elsewhere.
Parameters
----------
n : int
Number of rows in the output.
M : int, optional
Number of columns in the output, defaults to `n`.
k : int, optional
Index of the diagonal: 0 refers to the main diagonal,
a positive value refers to an upper diagonal,
and a negative value to a lower diagonal.
dtype : dtype, optional
Data-type of the returned matrix.
order : {'C', 'F'}, optional
Whether the output should be stored in row-major (C-style) or
column-major (Fortran-style) order in memory.
.. versionadded:: 1.14.0
Returns
-------
I : matrix
A `n` x `M` matrix where all elements are equal to zero,
except for the `k`-th diagonal, whose values are equal to one.
See Also
--------
numpy.eye : Equivalent array function.
identity : Square identity matrix.
Examples
--------
>>> import numpy.matlib
>>> np.matlib.eye(3, k=1, dtype=float)
matrix([[0., 1., 0.],
[0., 0., 1.],
[0., 0., 0.]])
"""
...
def rand(*args): # -> matrix[Any, Any]:
"""
Return a matrix of random values with given shape.
Create a matrix of the given shape and propagate it with
random samples from a uniform distribution over ``[0, 1)``.
Parameters
----------
\\*args : Arguments
Shape of the output.
If given as N integers, each integer specifies the size of one
dimension.
If given as a tuple, this tuple gives the complete shape.
Returns
-------
out : ndarray
The matrix of random values with shape given by `\\*args`.
See Also
--------
randn, numpy.random.RandomState.rand
Examples
--------
>>> np.random.seed(123)
>>> import numpy.matlib
>>> np.matlib.rand(2, 3)
matrix([[0.69646919, 0.28613933, 0.22685145],
[0.55131477, 0.71946897, 0.42310646]])
>>> np.matlib.rand((2, 3))
matrix([[0.9807642 , 0.68482974, 0.4809319 ],
[0.39211752, 0.34317802, 0.72904971]])
If the first argument is a tuple, other arguments are ignored:
>>> np.matlib.rand((2, 3), 4)
matrix([[0.43857224, 0.0596779 , 0.39804426],
[0.73799541, 0.18249173, 0.17545176]])
"""
...
def randn(*args): # -> matrix[Any, Any]:
"""
Return a random matrix with data from the "standard normal" distribution.
`randn` generates a matrix filled with random floats sampled from a
univariate "normal" (Gaussian) distribution of mean 0 and variance 1.
Parameters
----------
\\*args : Arguments
Shape of the output.
If given as N integers, each integer specifies the size of one
dimension. If given as a tuple, this tuple gives the complete shape.
Returns
-------
Z : matrix of floats
A matrix of floating-point samples drawn from the standard normal
distribution.
See Also
--------
rand, numpy.random.RandomState.randn
Notes
-----
For random samples from the normal distribution with mean ``mu`` and
standard deviation ``sigma``, use::
sigma * np.matlib.randn(...) + mu
Examples
--------
>>> np.random.seed(123)
>>> import numpy.matlib
>>> np.matlib.randn(1)
matrix([[-1.0856306]])
>>> np.matlib.randn(1, 2, 3)
matrix([[ 0.99734545, 0.2829785 , -1.50629471],
[-0.57860025, 1.65143654, -2.42667924]])
Two-by-four matrix of samples from the normal distribution with
mean 3 and standard deviation 2.5:
>>> 2.5 * np.matlib.randn((2, 4)) + 3
matrix([[1.92771843, 6.16484065, 0.83314899, 1.30278462],
[2.76322758, 6.72847407, 1.40274501, 1.8900451 ]])
"""
...
def repmat(a, m, n):
"""
Repeat a 0-D to 2-D array or matrix MxN times.
Parameters
----------
a : array_like
The array or matrix to be repeated.
m, n : int
The number of times `a` is repeated along the first and second axes.
Returns
-------
out : ndarray
The result of repeating `a`.
Examples
--------
>>> import numpy.matlib
>>> a0 = np.array(1)
>>> np.matlib.repmat(a0, 2, 3)
array([[1, 1, 1],
[1, 1, 1]])
>>> a1 = np.arange(4)
>>> np.matlib.repmat(a1, 2, 2)
array([[0, 1, 2, 3, 0, 1, 2, 3],
[0, 1, 2, 3, 0, 1, 2, 3]])
>>> a2 = np.asmatrix(np.arange(6).reshape(2, 3))
>>> np.matlib.repmat(a2, 2, 3)
matrix([[0, 1, 2, 0, 1, 2, 0, 1, 2],
[3, 4, 5, 3, 4, 5, 3, 4, 5],
[0, 1, 2, 0, 1, 2, 0, 1, 2],
[3, 4, 5, 3, 4, 5, 3, 4, 5]])
"""
...

View file

@ -0,0 +1,11 @@
"""
This type stub file was generated by pyright.
"""
from numpy._pytesttester import PytestTester
from numpy import matrix as matrix
from numpy.matrixlib.defmatrix import asmatrix as asmatrix, bmat as bmat, mat as mat
__all__: list[str]
__path__: list[str]
test: PytestTester

View file

@ -0,0 +1,17 @@
"""
This type stub file was generated by pyright.
"""
from collections.abc import Mapping, Sequence
from typing import Any
from numpy import matrix as matrix
from numpy._typing import ArrayLike, DTypeLike, NDArray
__all__: list[str]
def bmat(obj: str | Sequence[ArrayLike] | NDArray[Any], ldict: None | Mapping[str, Any] = ..., gdict: None | Mapping[str, Any] = ...) -> matrix[Any, Any]:
...
def asmatrix(data: ArrayLike, dtype: DTypeLike = ...) -> matrix[Any, Any]:
...
mat = ...

View file

@ -0,0 +1,19 @@
"""
This type stub file was generated by pyright.
"""
from numpy._pytesttester import PytestTester
from numpy.polynomial import chebyshev as chebyshev, hermite as hermite, hermite_e as hermite_e, laguerre as laguerre, legendre as legendre, polynomial as polynomial
from numpy.polynomial.chebyshev import Chebyshev as Chebyshev
from numpy.polynomial.hermite import Hermite as Hermite
from numpy.polynomial.hermite_e import HermiteE as HermiteE
from numpy.polynomial.laguerre import Laguerre as Laguerre
from numpy.polynomial.legendre import Legendre as Legendre
from numpy.polynomial.polynomial import Polynomial as Polynomial
__all__: list[str]
__path__: list[str]
test: PytestTester
def set_default_printstyle(style):
...

View file

@ -0,0 +1,174 @@
"""
This type stub file was generated by pyright.
"""
import abc
from typing import Any, ClassVar
__all__: list[str]
class ABCPolyBase(abc.ABC):
__hash__: ClassVar[None]
__array_ufunc__: ClassVar[None]
maxpower: ClassVar[int]
coef: Any
@property
def symbol(self) -> str:
...
@property
@abc.abstractmethod
def domain(self):
...
@property
@abc.abstractmethod
def window(self):
...
@property
@abc.abstractmethod
def basis_name(self):
...
def has_samecoef(self, other):
...
def has_samedomain(self, other):
...
def has_samewindow(self, other):
...
def has_sametype(self, other):
...
def __init__(self, coef, domain=..., window=..., symbol: str = ...) -> None:
...
def __format__(self, fmt_str):
...
def __call__(self, arg):
...
def __iter__(self):
...
def __len__(self):
...
def __neg__(self):
...
def __pos__(self):
...
def __add__(self, other):
...
def __sub__(self, other):
...
def __mul__(self, other):
...
def __truediv__(self, other):
...
def __floordiv__(self, other):
...
def __mod__(self, other):
...
def __divmod__(self, other):
...
def __pow__(self, other):
...
def __radd__(self, other):
...
def __rsub__(self, other):
...
def __rmul__(self, other):
...
def __rdiv__(self, other):
...
def __rtruediv__(self, other):
...
def __rfloordiv__(self, other):
...
def __rmod__(self, other):
...
def __rdivmod__(self, other):
...
def __eq__(self, other) -> bool:
...
def __ne__(self, other) -> bool:
...
def copy(self):
...
def degree(self):
...
def cutdeg(self, deg):
...
def trim(self, tol=...):
...
def truncate(self, size):
...
def convert(self, domain=..., kind=..., window=...):
...
def mapparms(self):
...
def integ(self, m=..., k=..., lbnd=...):
...
def deriv(self, m=...):
...
def roots(self):
...
def linspace(self, n=..., domain=...):
...
@classmethod
def fit(cls, x, y, deg, domain=..., rcond=..., full=..., w=..., window=...):
...
@classmethod
def fromroots(cls, roots, domain=..., window=...):
...
@classmethod
def identity(cls, domain=..., window=...):
...
@classmethod
def basis(cls, deg, domain=..., window=...):
...
@classmethod
def cast(cls, series, domain=..., window=...):
...

View file

@ -0,0 +1,108 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any
from numpy import dtype, int_, ndarray
from numpy.polynomial._polybase import ABCPolyBase
__all__: list[str]
chebtrim = ...
def poly2cheb(pol):
...
def cheb2poly(c):
...
chebdomain: ndarray[Any, dtype[int_]]
chebzero: ndarray[Any, dtype[int_]]
chebone: ndarray[Any, dtype[int_]]
chebx: ndarray[Any, dtype[int_]]
def chebline(off, scl):
...
def chebfromroots(roots):
...
def chebadd(c1, c2):
...
def chebsub(c1, c2):
...
def chebmulx(c):
...
def chebmul(c1, c2):
...
def chebdiv(c1, c2):
...
def chebpow(c, pow, maxpower=...):
...
def chebder(c, m=..., scl=..., axis=...):
...
def chebint(c, m=..., k=..., lbnd=..., scl=..., axis=...):
...
def chebval(x, c, tensor=...):
...
def chebval2d(x, y, c):
...
def chebgrid2d(x, y, c):
...
def chebval3d(x, y, z, c):
...
def chebgrid3d(x, y, z, c):
...
def chebvander(x, deg):
...
def chebvander2d(x, y, deg):
...
def chebvander3d(x, y, z, deg):
...
def chebfit(x, y, deg, rcond=..., full=..., w=...):
...
def chebcompanion(c):
...
def chebroots(c):
...
def chebinterpolate(func, deg, args=...):
...
def chebgauss(deg):
...
def chebweight(x):
...
def chebpts1(npts):
...
def chebpts2(npts):
...
class Chebyshev(ABCPolyBase):
@classmethod
def interpolate(cls, func, deg, domain=..., args=...):
...
domain: Any
window: Any
basis_name: Any

View file

@ -0,0 +1,96 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any
from numpy import dtype, float_, int_, ndarray
from numpy.polynomial._polybase import ABCPolyBase
__all__: list[str]
hermtrim = ...
def poly2herm(pol):
...
def herm2poly(c):
...
hermdomain: ndarray[Any, dtype[int_]]
hermzero: ndarray[Any, dtype[int_]]
hermone: ndarray[Any, dtype[int_]]
hermx: ndarray[Any, dtype[float_]]
def hermline(off, scl):
...
def hermfromroots(roots):
...
def hermadd(c1, c2):
...
def hermsub(c1, c2):
...
def hermmulx(c):
...
def hermmul(c1, c2):
...
def hermdiv(c1, c2):
...
def hermpow(c, pow, maxpower=...):
...
def hermder(c, m=..., scl=..., axis=...):
...
def hermint(c, m=..., k=..., lbnd=..., scl=..., axis=...):
...
def hermval(x, c, tensor=...):
...
def hermval2d(x, y, c):
...
def hermgrid2d(x, y, c):
...
def hermval3d(x, y, z, c):
...
def hermgrid3d(x, y, z, c):
...
def hermvander(x, deg):
...
def hermvander2d(x, y, deg):
...
def hermvander3d(x, y, z, deg):
...
def hermfit(x, y, deg, rcond=..., full=..., w=...):
...
def hermcompanion(c):
...
def hermroots(c):
...
def hermgauss(deg):
...
def hermweight(x):
...
class Hermite(ABCPolyBase):
domain: Any
window: Any
basis_name: Any
...

View file

@ -0,0 +1,96 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any
from numpy import dtype, int_, ndarray
from numpy.polynomial._polybase import ABCPolyBase
__all__: list[str]
hermetrim = ...
def poly2herme(pol):
...
def herme2poly(c):
...
hermedomain: ndarray[Any, dtype[int_]]
hermezero: ndarray[Any, dtype[int_]]
hermeone: ndarray[Any, dtype[int_]]
hermex: ndarray[Any, dtype[int_]]
def hermeline(off, scl):
...
def hermefromroots(roots):
...
def hermeadd(c1, c2):
...
def hermesub(c1, c2):
...
def hermemulx(c):
...
def hermemul(c1, c2):
...
def hermediv(c1, c2):
...
def hermepow(c, pow, maxpower=...):
...
def hermeder(c, m=..., scl=..., axis=...):
...
def hermeint(c, m=..., k=..., lbnd=..., scl=..., axis=...):
...
def hermeval(x, c, tensor=...):
...
def hermeval2d(x, y, c):
...
def hermegrid2d(x, y, c):
...
def hermeval3d(x, y, z, c):
...
def hermegrid3d(x, y, z, c):
...
def hermevander(x, deg):
...
def hermevander2d(x, y, deg):
...
def hermevander3d(x, y, z, deg):
...
def hermefit(x, y, deg, rcond=..., full=..., w=...):
...
def hermecompanion(c):
...
def hermeroots(c):
...
def hermegauss(deg):
...
def hermeweight(x):
...
class HermiteE(ABCPolyBase):
domain: Any
window: Any
basis_name: Any
...

View file

@ -0,0 +1,96 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any
from numpy import dtype, int_, ndarray
from numpy.polynomial._polybase import ABCPolyBase
__all__: list[str]
lagtrim = ...
def poly2lag(pol):
...
def lag2poly(c):
...
lagdomain: ndarray[Any, dtype[int_]]
lagzero: ndarray[Any, dtype[int_]]
lagone: ndarray[Any, dtype[int_]]
lagx: ndarray[Any, dtype[int_]]
def lagline(off, scl):
...
def lagfromroots(roots):
...
def lagadd(c1, c2):
...
def lagsub(c1, c2):
...
def lagmulx(c):
...
def lagmul(c1, c2):
...
def lagdiv(c1, c2):
...
def lagpow(c, pow, maxpower=...):
...
def lagder(c, m=..., scl=..., axis=...):
...
def lagint(c, m=..., k=..., lbnd=..., scl=..., axis=...):
...
def lagval(x, c, tensor=...):
...
def lagval2d(x, y, c):
...
def laggrid2d(x, y, c):
...
def lagval3d(x, y, z, c):
...
def laggrid3d(x, y, z, c):
...
def lagvander(x, deg):
...
def lagvander2d(x, y, deg):
...
def lagvander3d(x, y, z, deg):
...
def lagfit(x, y, deg, rcond=..., full=..., w=...):
...
def lagcompanion(c):
...
def lagroots(c):
...
def laggauss(deg):
...
def lagweight(x):
...
class Laguerre(ABCPolyBase):
domain: Any
window: Any
basis_name: Any
...

View file

@ -0,0 +1,96 @@
"""
This type stub file was generated by pyright.
"""
from typing import Any
from numpy import dtype, int_, ndarray
from numpy.polynomial._polybase import ABCPolyBase
__all__: list[str]
legtrim = ...
def poly2leg(pol):
...
def leg2poly(c):
...
legdomain: ndarray[Any, dtype[int_]]
legzero: ndarray[Any, dtype[int_]]
legone: ndarray[Any, dtype[int_]]
legx: ndarray[Any, dtype[int_]]
def legline(off, scl):
...
def legfromroots(roots):
...
def legadd(c1, c2):
...
def legsub(c1, c2):
...
def legmulx(c):
...
def legmul(c1, c2):
...
def legdiv(c1, c2):
...
def legpow(c, pow, maxpower=...):
...
def legder(c, m=..., scl=..., axis=...):
...
def legint(c, m=..., k=..., lbnd=..., scl=..., axis=...):
...
def legval(x, c, tensor=...):
...
def legval2d(x, y, c):
...
def leggrid2d(x, y, c):
...
def legval3d(x, y, z, c):
...
def leggrid3d(x, y, z, c):
...
def legvander(x, deg):
...
def legvander2d(x, y, deg):
...
def legvander3d(x, y, z, deg):
...
def legfit(x, y, deg, rcond=..., full=..., w=...):
...
def legcompanion(c):
...
def legroots(c):
...
def leggauss(deg):
...
def legweight(x):
...
class Legendre(ABCPolyBase):
domain: Any
window: Any
basis_name: Any
...

Some files were not shown because too many files have changed in this diff Show more