Skip to content

Commit f744f36

Browse files
committed
TYP: Explicit numpy.__all__ in the stubs
1 parent 89b6820 commit f744f36

File tree

1 file changed

+120
-1
lines changed

1 file changed

+120
-1
lines changed

numpy/__init__.pyi

Lines changed: 120 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,126 @@ from numpy.matrixlib import (
613613
bmat as bmat,
614614
)
615615

616+
__all__ = [
617+
"emath", "show_config", "__version__", "__array_namespace_info__",
618+
619+
# __numpy_submodules__
620+
"linalg", "fft", "dtypes", "random", "polynomial", "ma", "exceptions", "lib",
621+
"ctypeslib", "testing", "test", "rec", "char", "strings",
622+
"core", "typing", "f2py",
623+
624+
# _core.__all__
625+
"abs", "acos", "acosh", "asin", "asinh", "atan", "atanh", "atan2", "bitwise_invert",
626+
"bitwise_left_shift", "bitwise_right_shift", "concat", "pow", "permute_dims",
627+
"memmap", "sctypeDict", "record", "recarray",
628+
629+
# _core.numeric.__all__
630+
"newaxis", "ndarray", "flatiter", "nditer", "nested_iters", "ufunc", "arange",
631+
"array", "asarray", "asanyarray", "ascontiguousarray", "asfortranarray", "zeros",
632+
"count_nonzero", "empty", "broadcast", "dtype", "fromstring", "fromfile",
633+
"frombuffer", "from_dlpack", "where", "argwhere", "copyto", "concatenate",
634+
"lexsort", "astype", "can_cast", "promote_types", "min_scalar_type", "result_type",
635+
"isfortran", "empty_like", "zeros_like", "ones_like", "correlate", "convolve",
636+
"inner", "dot", "outer", "vdot", "roll", "rollaxis", "moveaxis", "cross",
637+
"tensordot", "little_endian", "fromiter", "array_equal", "array_equiv", "indices",
638+
"fromfunction", "isclose", "isscalar", "binary_repr", "base_repr", "ones",
639+
"identity", "allclose", "putmask", "flatnonzero", "inf", "nan", "False_", "True_",
640+
"bitwise_not", "full", "full_like", "matmul", "vecdot", "shares_memory",
641+
"may_share_memory", "_get_promotion_state", "_set_promotion_state",
642+
"all", "amax", "amin", "any", "argmax", "argmin", "argpartition", "argsort",
643+
"around", "choose", "clip", "compress", "cumprod", "cumsum", "cumulative_prod",
644+
"cumulative_sum", "diagonal", "mean", "max", "min", "matrix_transpose", "ndim",
645+
"nonzero", "partition", "prod", "ptp", "put", "ravel", "repeat", "reshape",
646+
"resize", "round", "searchsorted", "shape", "size", "sort", "squeeze", "std", "sum",
647+
"swapaxes", "take", "trace", "transpose", "var",
648+
"absolute", "add", "arccos", "arccosh", "arcsin", "arcsinh", "arctan", "arctan2",
649+
"arctanh", "bitwise_and", "bitwise_or", "bitwise_xor", "cbrt", "ceil", "conj",
650+
"conjugate", "copysign", "cos", "cosh", "bitwise_count", "deg2rad", "degrees",
651+
"divide", "divmod", "e", "equal", "euler_gamma", "exp", "exp2", "expm1", "fabs",
652+
"floor", "floor_divide", "float_power", "fmax", "fmin", "fmod", "frexp",
653+
"frompyfunc", "gcd", "greater", "greater_equal", "heaviside", "hypot", "invert",
654+
"isfinite", "isinf", "isnan", "isnat", "lcm", "ldexp", "left_shift", "less",
655+
"less_equal", "log", "log10", "log1p", "log2", "logaddexp", "logaddexp2",
656+
"logical_and", "logical_not", "logical_or", "logical_xor", "maximum", "minimum",
657+
"mod", "modf", "multiply", "negative", "nextafter", "not_equal", "pi", "positive",
658+
"power", "rad2deg", "radians", "reciprocal", "remainder", "right_shift", "rint",
659+
"sign", "signbit", "sin", "sinh", "spacing", "sqrt", "square", "subtract", "tan",
660+
"tanh", "true_divide", "trunc", "ScalarType", "typecodes", "issubdtype",
661+
"datetime_data", "datetime_as_string", "busday_offset", "busday_count", "is_busday",
662+
"busdaycalendar", "isdtype",
663+
"complexfloating", "character", "unsignedinteger", "inexact", "generic", "floating",
664+
"integer", "signedinteger", "number", "flexible", "bool", "float16", "float32",
665+
"float64", "longdouble", "complex64", "complex128", "clongdouble",
666+
"bytes_", "str_", "void", "object_", "datetime64", "timedelta64", "int8", "byte",
667+
"uint8", "ubyte", "int16", "short", "uint16", "ushort", "int32", "intc", "uint32",
668+
"uintc", "int64", "long", "uint64", "ulong", "longlong", "ulonglong", "intp",
669+
"uintp", "double", "cdouble", "single", "csingle", "half", "bool_", "int_", "uint",
670+
"uint128", "uint256", "int128", "int256", "float80", "float96", "float128",
671+
"float256", "complex160", "complex192", "complex256", "complex512",
672+
"array2string", "array_str", "array_repr", "set_printoptions", "get_printoptions",
673+
"printoptions", "format_float_positional", "format_float_scientific", "require",
674+
"seterr", "geterr", "setbufsize", "getbufsize", "seterrcall", "geterrcall",
675+
"errstate", "_no_nep50_warning",
676+
# _core.function_base.__all__
677+
"logspace", "linspace", "geomspace",
678+
# _core.getlimits.__all__
679+
"finfo", "iinfo",
680+
# _core.shape_base.__all__
681+
"atleast_1d", "atleast_2d", "atleast_3d", "block", "hstack", "stack", "unstack",
682+
"vstack",
683+
# _core.einsumfunc.__all__
684+
"einsum", "einsum_path",
685+
686+
# lib._histograms_impl.__all__
687+
"histogram", "histogramdd", "histogram_bin_edges",
688+
# lib._nanfunctions_impl.__all__
689+
"nansum", "nanmax", "nanmin", "nanargmax", "nanargmin", "nanmean", "nanmedian",
690+
"nanpercentile", "nanvar", "nanstd", "nanprod", "nancumsum", "nancumprod",
691+
"nanquantile",
692+
# lib._function_base_impl.__all__
693+
"select", "piecewise", "trim_zeros", "copy", "iterable", "percentile", "diff",
694+
"gradient", "angle", "unwrap", "sort_complex", "flip", "rot90", "extract", "place",
695+
"vectorize", "asarray_chkfinite", "average", "bincount", "digitize", "cov",
696+
"corrcoef", "median", "sinc", "hamming", "hanning", "bartlett", "blackman",
697+
"kaiser", "i0", "meshgrid", "delete", "insert", "append", "interp", "quantile",
698+
"trapezoid", # "trapz",
699+
# lib._twodim_base_impl.__all__
700+
"diag", "diagflat", "eye", "fliplr", "flipud", "tri", "triu", "tril", "vander",
701+
"histogram2d", "mask_indices", "tril_indices", "tril_indices_from", "triu_indices",
702+
"triu_indices_from",
703+
# lib._shape_base_impl.__all__
704+
"column_stack", "dstack", "array_split", "split", "hsplit", "vsplit", "dsplit",
705+
"apply_over_axes", "expand_dims", "apply_along_axis", "kron", "tile",
706+
"take_along_axis", "put_along_axis", # "row_stack",
707+
# lib._type_check_impl.__all__
708+
"iscomplexobj", "isrealobj", "imag", "iscomplex", "isreal", "nan_to_num", "real",
709+
"real_if_close", "typename", "mintypecode", "common_type",
710+
# lib._arraysetops_impl.__all__
711+
"ediff1d", "intersect1d", "isin", "setdiff1d", "setxor1d", "union1d", "unique",
712+
"unique_all", "unique_counts", "unique_inverse", "unique_values", # "in1d",
713+
# lib._ufunclike_impl.__all__
714+
"fix", "isneginf", "isposinf",
715+
# lib._arraypad_impl.__all__
716+
"pad",
717+
# lib._utils_impl.__all__
718+
"get_include", "info", "show_runtime",
719+
# lib._stride_tricks_impl.__all__
720+
"broadcast_to", "broadcast_arrays", "broadcast_shapes",
721+
# lib._polynomial_impl.__all__
722+
"poly", "roots", "polyint", "polyder", "polyadd", "polysub", "polymul", "polydiv",
723+
"polyval", "poly1d", "polyfit",
724+
# lib._npyio_impl.__all__
725+
"savetxt", "loadtxt", "genfromtxt", "load", "save", "savez", "savez_compressed",
726+
"packbits", "unpackbits", "fromregex",
727+
# lib._index_tricks_impl.__all__
728+
"ravel_multi_index", "unravel_index", "mgrid", "ogrid", "r_", "c_", "s_",
729+
"index_exp", "ix_", "ndenumerate", "ndindex", "fill_diagonal", "diag_indices",
730+
"diag_indices_from",
731+
732+
# matrixlib.__all__
733+
"matrix", "bmat", "asmatrix",
734+
]
735+
616736
_AnyStr_contra = TypeVar("_AnyStr_contra", LiteralString, builtins.str, bytes, contravariant=True)
617737

618738
# Protocol for representing file-like-objects accepted
@@ -637,7 +757,6 @@ class _MemMapIOProtocol(Protocol):
637757
class _SupportsWrite(Protocol[_AnyStr_contra]):
638758
def write(self, s: _AnyStr_contra, /) -> object: ...
639759

640-
__all__: list[str]
641760
def __dir__() -> Sequence[str]: ...
642761

643762
__version__: LiteralString

0 commit comments

Comments
 (0)