summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/__init__.pyi428
1 files changed, 219 insertions, 209 deletions
diff --git a/numpy/__init__.pyi b/numpy/__init__.pyi
index a963493ce..8565d4b40 100644
--- a/numpy/__init__.pyi
+++ b/numpy/__init__.pyi
@@ -365,62 +365,219 @@ __path__: List[str]
__version__: str
__git_version__: str
-DataSource: Any
-MachAr: Any
-ScalarType: Any
-angle: Any
-append: Any
-apply_along_axis: Any
-apply_over_axes: Any
-arange: Any
-array_split: Any
-asarray_chkfinite: Any
-asfarray: Any
-asmatrix: Any
-asscalar: Any
-average: Any
-bartlett: Any
-bincount: Any
-bitwise_not: Any
-blackman: Any
-bmat: Any
-broadcast: Any
-broadcast_arrays: Any
-broadcast_to: Any
-busday_count: Any
-busday_offset: Any
-busdaycalendar: Any
-byte_bounds: Any
-can_cast: Any
-cast: Any
-chararray: Any
-column_stack: Any
-common_type: Any
-compare_chararrays: Any
-concatenate: Any
-conj: Any
-copy: Any
-copyto: Any
-corrcoef: Any
-cov: Any
-cumproduct: Any
-datetime_as_string: Any
-datetime_data: Any
-delete: Any
-deprecate: Any
-deprecate_with_doc: Any
-diag: Any
-diagflat: Any
-diff: Any
-digitize: Any
-disp: Any
-divide: Any
-dot: Any
-dsplit: Any
-dstack: Any
-ediff1d: Any
-expand_dims: Any
-extract: Any
+# TODO: Move placeholders to their respective module once
+# their annotations are properly implemented
+#
+# Placeholders for non-functions (types and other objects)
+DataSource: Type[Any]
+MachAr: Type[Any]
+ScalarType: Tuple[Type[Any], ...]
+broadcast: Type[Any]
+busdaycalendar: Type[Any]
+cast: Dict[generic, Callable[..., ndarray[Any, dtype[Any]]]]
+chararray: Type[Any]
+finfo: Type[Any]
+format_parser: Type[Any]
+iinfo: Type[Any]
+matrix: Type[Any]
+memmap: Type[Any]
+nbytes: Dict[generic, int]
+nditer: Type[Any]
+poly1d: Type[Any]
+recarray: Type[Any]
+record: Type[Any]
+typecodes: Dict[str, str]
+vectorize: Type[Any]
+
+# Placeholders for Python-based functions
+def angle(z, deg=...): ...
+def append(arr, values, axis=...): ...
+def apply_along_axis(func1d, axis, arr, *args, **kwargs): ...
+def apply_over_axes(func, a, axes): ...
+def array_split(ary, indices_or_sections, axis=...): ...
+def asarray_chkfinite(a, dtype=..., order=...): ...
+def asfarray(a, dtype=...): ...
+def asmatrix(data, dtype=...): ...
+def asscalar(a): ...
+def average(a, axis=..., weights=..., returned=...): ...
+def bartlett(M): ...
+def blackman(M): ...
+def bmat(obj, ldict=..., gdict=...): ...
+def broadcast_arrays(*args, subok=...): ...
+def broadcast_to(array, shape, subok=...): ...
+def byte_bounds(a): ...
+def column_stack(tup): ...
+def common_type(*arrays): ...
+def copy(a, order=..., subok=...): ...
+def corrcoef(x, y=..., rowvar=..., bias=..., ddof=..., *, dtype=...): ...
+def cov(m, y=..., rowvar=..., bias=..., ddof=..., fweights=..., aweights=..., *, dtype=...): ...
+def cumproduct(*args, **kwargs): ...
+def delete(arr, obj, axis=...): ...
+def deprecate(*args, **kwargs): ...
+def deprecate_with_doc(msg): ...
+def diag(v, k=...): ...
+def diagflat(v, k=...): ...
+def diff(a, n=..., axis=..., prepend=..., append=...): ...
+def digitize(x, bins, right=...): ...
+def disp(mesg, device=..., linefeed=...): ...
+def dsplit(ary, indices_or_sections): ...
+def dstack(tup): ...
+def ediff1d(ary, to_end=..., to_begin=...): ...
+def expand_dims(a, axis): ...
+def extract(condition, arr): ...
+def flip(m, axis=...): ...
+def fliplr(m): ...
+def flipud(m): ...
+def fromregex(file, regexp, dtype, encoding=...): ...
+def genfromtxt(fname, dtype=..., comments=..., delimiter=..., skip_header=..., skip_footer=..., converters=..., missing_values=..., filling_values=..., usecols=..., names=..., excludelist=..., deletechars=..., replace_space=..., autostrip=..., case_sensitive=..., defaultfmt=..., unpack=..., usemask=..., loose=..., invalid_raise=..., max_rows=..., encoding=..., *, like=...): ...
+def get_include(): ...
+def gradient(f, *varargs, axis=..., edge_order=...): ...
+def hamming(M): ...
+def hanning(M): ...
+def histogram(a, bins=..., range=..., normed=..., weights=..., density=...): ...
+def histogram2d(x, y, bins=..., range=..., normed=..., weights=..., density=...): ...
+def histogram_bin_edges(a, bins=..., range=..., weights=...): ...
+def histogramdd(sample, bins=..., range=..., normed=..., weights=..., density=...): ...
+def hsplit(ary, indices_or_sections): ...
+def i0(x): ...
+def imag(val): ...
+def in1d(ar1, ar2, assume_unique=..., invert=...): ...
+def info(object=..., maxwidth=..., output=..., toplevel=...): ...
+def insert(arr, obj, values, axis=...): ...
+def interp(x, xp, fp, left=..., right=..., period=...): ...
+def intersect1d(ar1, ar2, assume_unique=..., return_indices=...): ...
+def iscomplex(x): ...
+def iscomplexobj(x): ...
+def isin(element, test_elements, assume_unique=..., invert=...): ...
+def isreal(x): ...
+def isrealobj(x): ...
+def iterable(y): ...
+def kaiser(M, beta): ...
+def kron(a, b): ...
+def load(file, mmap_mode=..., allow_pickle=..., fix_imports=..., encoding=...): ...
+def loads(*args, **kwargs): ...
+def loadtxt(fname, dtype=..., comments=..., delimiter=..., converters=..., skiprows=..., usecols=..., unpack=..., ndmin=..., encoding=..., max_rows=..., *, like=...): ...
+def lookfor(what, module=..., import_modules=..., regenerate=..., output=...): ...
+def mafromtxt(fname, **kwargs): ...
+def mask_indices(n, mask_func, k=...): ...
+def mat(data, dtype=...): ...
+def max(a, axis=..., out=..., keepdims=..., initial=..., where=...): ...
+def median(a, axis=..., out=..., overwrite_input=..., keepdims=...): ...
+def meshgrid(*xi, copy=..., sparse=..., indexing=...): ...
+def min(a, axis=..., out=..., keepdims=..., initial=..., where=...): ...
+def mintypecode(typechars, typeset=..., default=...): ...
+def msort(a): ...
+def nan_to_num(x, copy=..., nan=..., posinf=..., neginf=...): ...
+def nanargmax(a, axis=...): ...
+def nanargmin(a, axis=...): ...
+def nancumprod(a, axis=..., dtype=..., out=...): ...
+def nancumsum(a, axis=..., dtype=..., out=...): ...
+def nanmax(a, axis=..., out=..., keepdims=...): ...
+def nanmean(a, axis=..., dtype=..., out=..., keepdims=...): ...
+def nanmedian(a, axis=..., out=..., overwrite_input=..., keepdims=...): ...
+def nanmin(a, axis=..., out=..., keepdims=...): ...
+def nanpercentile(a, q, axis=..., out=..., overwrite_input=..., interpolation=..., keepdims=...): ...
+def nanprod(a, axis=..., dtype=..., out=..., keepdims=...): ...
+def nanquantile(a, q, axis=..., out=..., overwrite_input=..., interpolation=..., keepdims=...): ...
+def nanstd(a, axis=..., dtype=..., out=..., ddof=..., keepdims=...): ...
+def nansum(a, axis=..., dtype=..., out=..., keepdims=...): ...
+def nanvar(a, axis=..., dtype=..., out=..., ddof=..., keepdims=...): ...
+def ndfromtxt(fname, **kwargs): ...
+def pad(array, pad_width, mode=..., **kwargs): ...
+def percentile(a, q, axis=..., out=..., overwrite_input=..., interpolation=..., keepdims=...): ...
+def piecewise(x, condlist, funclist, *args, **kw): ...
+def place(arr, mask, vals): ...
+def poly(seq_of_zeros): ...
+def polyadd(a1, a2): ...
+def polyder(p, m=...): ...
+def polydiv(u, v): ...
+def polyfit(x, y, deg, rcond=..., full=..., w=..., cov=...): ...
+def polyint(p, m=..., k=...): ...
+def polymul(a1, a2): ...
+def polysub(a1, a2): ...
+def polyval(p, x): ...
+def product(*args, **kwargs): ...
+def put_along_axis(arr, indices, values, axis): ...
+def quantile(a, q, axis=..., out=..., overwrite_input=..., interpolation=..., keepdims=...): ...
+def real(val): ...
+def real_if_close(a, tol=...): ...
+def recfromcsv(fname, **kwargs): ...
+def recfromtxt(fname, **kwargs): ...
+def roots(p): ...
+def rot90(m, k=..., axes=...): ...
+def round(a, decimals=..., out=...): ...
+def round_(a, decimals=..., out=...): ...
+def row_stack(tup): ...
+def save(file, arr, allow_pickle=..., fix_imports=...): ...
+def savetxt(fname, X, fmt=..., delimiter=..., newline=..., header=..., footer=..., comments=..., encoding=...): ...
+def savez(file, *args, **kwds): ...
+def savez_compressed(file, *args, **kwds): ...
+def select(condlist, choicelist, default=...): ...
+def setdiff1d(ar1, ar2, assume_unique=...): ...
+def setxor1d(ar1, ar2, assume_unique=...): ...
+def show_config(): ...
+def sinc(x): ...
+def sort_complex(a): ...
+def source(object, output=...): ...
+def split(ary, indices_or_sections, axis=...): ...
+def take_along_axis(arr, indices, axis): ...
+def tile(A, reps): ...
+def trapz(y, x=..., dx=..., axis=...): ...
+def tri(N, M=..., k=..., dtype=..., *, like=...): ...
+def tril(m, k=...): ...
+def tril_indices(n, k=..., m=...): ...
+def tril_indices_from(arr, k=...): ...
+def trim_zeros(filt, trim=...): ...
+def triu(m, k=...): ...
+def triu_indices(n, k=..., m=...): ...
+def triu_indices_from(arr, k=...): ...
+def typename(char): ...
+def union1d(ar1, ar2): ...
+def unique(ar, return_index=..., return_inverse=..., return_counts=..., axis=...): ...
+def unwrap(p, discont=..., axis=...): ...
+def vander(x, N=..., increasing=...): ...
+def vsplit(ary, indices_or_sections): ...
+def who(vardict=...): ...
+
+# Placeholders for C-based functions
+arange: Callable[..., Any]
+bincount: Callable[..., Any]
+busday_count: Callable[..., Any]
+busday_offset: Callable[..., Any]
+can_cast: Callable[..., Any]
+compare_chararrays: Callable[..., Any]
+concatenate: Callable[..., Any]
+copyto: Callable[..., Any]
+datetime_as_string: Callable[..., Any]
+datetime_data: Callable[..., Any]
+dot: Callable[..., Any]
+frombuffer: Callable[..., Any]
+fromfile: Callable[..., Any]
+fromiter: Callable[..., Any]
+frompyfunc: Callable[..., Any]
+fromstring: Callable[..., Any]
+geterrobj: Callable[..., Any]
+inner: Callable[..., Any]
+is_busday: Callable[..., Any]
+lexsort: Callable[..., Any]
+may_share_memory: Callable[..., Any]
+min_scalar_type: Callable[..., Any]
+nested_iters: Callable[..., Any]
+packbits: Callable[..., Any]
+promote_types: Callable[..., Any]
+putmask: Callable[..., Any]
+result_type: Callable[..., Any]
+seterrobj: Callable[..., Any]
+shares_memory: Callable[..., Any]
+unpackbits: Callable[..., Any]
+vdot: Callable[..., Any]
+where: Callable[..., Any]
+
+_NdArraySubClass = TypeVar("_NdArraySubClass", bound=ndarray)
+_DTypeScalar_co = TypeVar("_DTypeScalar_co", covariant=True, bound=generic)
+_ByteOrder = Literal["S", "<", ">", "=", "|", "L", "B", "N", "I"]
+
+# TODO: Move to `np.lib.twodim_base`
def eye(
N: int,
M: Optional[int] = ...,
@@ -430,159 +587,6 @@ def eye(
*,
like: Optional[ArrayLike] = ...
) -> ndarray[Any, Any]: ...
-finfo: Any
-flip: Any
-fliplr: Any
-flipud: Any
-format_parser: Any
-frombuffer: Any
-fromfile: Any
-fromiter: Any
-frompyfunc: Any
-fromregex: Any
-fromstring: Any
-genfromtxt: Any
-get_include: Any
-geterrobj: Any
-gradient: Any
-hamming: Any
-hanning: Any
-histogram: Any
-histogram2d: Any
-histogram_bin_edges: Any
-histogramdd: Any
-hsplit: Any
-i0: Any
-iinfo: Any
-imag: Any
-in1d: Any
-info: Any
-inner: Any
-insert: Any
-interp: Any
-intersect1d: Any
-is_busday: Any
-iscomplex: Any
-iscomplexobj: Any
-isin: Any
-isreal: Any
-isrealobj: Any
-iterable: Any
-kaiser: Any
-kron: Any
-lexsort: Any
-load: Any
-loads: Any
-loadtxt: Any
-lookfor: Any
-mafromtxt: Any
-mask_indices: Any
-mat: Any
-matrix: Any
-max: Any
-may_share_memory: Any
-median: Any
-memmap: Any
-meshgrid: Any
-min: Any
-min_scalar_type: Any
-mintypecode: Any
-mod: Any
-msort: Any
-nan_to_num: Any
-nanargmax: Any
-nanargmin: Any
-nancumprod: Any
-nancumsum: Any
-nanmax: Any
-nanmean: Any
-nanmedian: Any
-nanmin: Any
-nanpercentile: Any
-nanprod: Any
-nanquantile: Any
-nanstd: Any
-nansum: Any
-nanvar: Any
-nbytes: Any
-ndfromtxt: Any
-nditer: Any
-nested_iters: Any
-newaxis: Any
-numarray: Any
-packbits: Any
-pad: Any
-percentile: Any
-piecewise: Any
-place: Any
-poly: Any
-poly1d: Any
-polyadd: Any
-polyder: Any
-polydiv: Any
-polyfit: Any
-polyint: Any
-polymul: Any
-polysub: Any
-polyval: Any
-product: Any
-promote_types: Any
-put_along_axis: Any
-putmask: Any
-quantile: Any
-real: Any
-real_if_close: Any
-recarray: Any
-recfromcsv: Any
-recfromtxt: Any
-record: Any
-result_type: Any
-roots: Any
-rot90: Any
-round: Any
-round_: Any
-row_stack: Any
-save: Any
-savetxt: Any
-savez: Any
-savez_compressed: Any
-select: Any
-setdiff1d: Any
-seterrobj: Any
-setxor1d: Any
-shares_memory: Any
-show_config: Any
-sinc: Any
-sort_complex: Any
-source: Any
-split: Any
-take_along_axis: Any
-tile: Any
-trapz: Any
-tri: Any
-tril: Any
-tril_indices: Any
-tril_indices_from: Any
-trim_zeros: Any
-triu: Any
-triu_indices: Any
-triu_indices_from: Any
-typecodes: Any
-typename: Any
-union1d: Any
-unique: Any
-unpackbits: Any
-unwrap: Any
-vander: Any
-vdot: Any
-vectorize: Any
-vsplit: Any
-where: Any
-who: Any
-
-_NdArraySubClass = TypeVar("_NdArraySubClass", bound=ndarray)
-_DTypeScalar_co = TypeVar("_DTypeScalar_co", covariant=True, bound=generic)
-_ByteOrder = Literal["S", "<", ">", "=", "|", "L", "B", "N", "I"]
class dtype(Generic[_DTypeScalar_co]):
names: Optional[Tuple[str, ...]]
@@ -2907,6 +2911,8 @@ False_: Final[bool_]
UFUNC_PYVALS_NAME: Final[str]
+newaxis: None
+
class ufunc:
@property
def __name__(self) -> str: ...
@@ -2985,16 +2991,19 @@ arctan2: ufunc
arctan: ufunc
arctanh: ufunc
bitwise_and: ufunc
+bitwise_not: ufunc
bitwise_or: ufunc
bitwise_xor: ufunc
cbrt: ufunc
ceil: ufunc
+conj: ufunc
conjugate: ufunc
copysign: ufunc
cos: ufunc
cosh: ufunc
deg2rad: ufunc
degrees: ufunc
+divide: ufunc
divmod: ufunc
equal: ufunc
exp2: ufunc
@@ -3036,6 +3045,7 @@ logical_xor: ufunc
matmul: ufunc
maximum: ufunc
minimum: ufunc
+mod: ufunc
modf: ufunc
multiply: ufunc
negative: ufunc