diff --git a/src/numpy-stubs/@test/static/accept/getlimits.pyi b/src/numpy-stubs/@test/static/accept/getlimits.pyi index 61305636..20f231da 100644 --- a/src/numpy-stubs/@test/static/accept/getlimits.pyi +++ b/src/numpy-stubs/@test/static/accept/getlimits.pyi @@ -19,7 +19,7 @@ assert_type(np.finfo(c8), np.finfo[np.float32]) assert_type(np.finfo("f2"), np.finfo[np.float16]) assert_type(finfo_f8.dtype, np.dtype[np.float64]) -assert_type(finfo_f8.bits, Literal[2, 4, 8, 12, 16]) +assert_type(finfo_f8.bits, int) assert_type(finfo_f8.eps, np.float64) assert_type(finfo_f8.epsneg, np.float64) assert_type(finfo_f8.iexp, int) diff --git a/src/numpy-stubs/@test/static/reject/arrayprint.pyi b/src/numpy-stubs/@test/static/reject/arrayprint.pyi deleted file mode 100644 index bb33238e..00000000 --- a/src/numpy-stubs/@test/static/reject/arrayprint.pyi +++ /dev/null @@ -1,16 +0,0 @@ -from collections.abc import Callable -from typing import Any - -import _numtype as _nt -import numpy as np - -AR: _nt.Array[np.float64] -func1: Callable[[Any], str] -func2: Callable[[np.integer], str] - -np.array2string(AR, style=None) # type: ignore[call-overload] # pyright: ignore[reportArgumentType, reportCallIssue] -np.array2string(AR, legacy="1.14") # type: ignore[call-overload] # pyright: ignore[reportArgumentType] -np.array2string(AR, sign="*") # type: ignore[call-overload] # pyright: ignore[reportArgumentType] -np.array2string(AR, floatmode="default") # type: ignore[call-overload] # pyright: ignore[reportArgumentType] -np.array2string(AR, formatter={"A": func1}) # type: ignore[call-overload] # pyright: ignore[reportArgumentType] -np.array2string(AR, formatter={"float": func2}) # type: ignore[call-overload] # pyright: ignore[reportArgumentType] diff --git a/src/numpy-stubs/@test/static/reject/ndarray_misc.pyi b/src/numpy-stubs/@test/static/reject/ndarray_misc.pyi index 3ab90806..2fc030dd 100644 --- a/src/numpy-stubs/@test/static/reject/ndarray_misc.pyi +++ b/src/numpy-stubs/@test/static/reject/ndarray_misc.pyi @@ -15,11 +15,6 @@ ctypes_obj = AR_f8.ctypes ### -ctypes_obj.get_data() # pyright: ignore[reportDeprecated] -ctypes_obj.get_shape() # pyright: ignore[reportDeprecated] -ctypes_obj.get_strides() # pyright: ignore[reportDeprecated] -ctypes_obj.get_as_parameter() # pyright: ignore[reportDeprecated] - # NOTE: mypy stops analysis after something returns `NoReturn`; wrapping them in functions works around this def test_argpartition() -> None: diff --git a/src/numpy-stubs/_core/_add_newdocs.pyi b/src/numpy-stubs/_core/_add_newdocs.pyi index 758bafbb..2d004814 100644 --- a/src/numpy-stubs/_core/_add_newdocs.pyi +++ b/src/numpy-stubs/_core/_add_newdocs.pyi @@ -1,3 +1,2 @@ -from numpy._core.overrides import get_array_function_like_doc as get_array_function_like_doc - -def refer_to_array_attribute(attr: str, method: bool = True) -> tuple[str, str]: ... +from .function_base import add_newdoc as add_newdoc +from .overrides import get_array_function_like_doc as get_array_function_like_doc diff --git a/src/numpy-stubs/_core/_add_newdocs_scalars.pyi b/src/numpy-stubs/_core/_add_newdocs_scalars.pyi index 4a06c9b0..241f4a00 100644 --- a/src/numpy-stubs/_core/_add_newdocs_scalars.pyi +++ b/src/numpy-stubs/_core/_add_newdocs_scalars.pyi @@ -1,4 +1,3 @@ -from collections.abc import Iterable from typing import Final import numpy as np @@ -8,9 +7,10 @@ _system: Final[str] = ... _machine: Final[str] = ... _doc_alias_string: Final[str] = ... _bool_docstring: Final[str] = ... +bool_name: str = ... int_name: str = ... float_name: str = ... def numeric_type_aliases(aliases: list[tuple[str, str]]) -> list[tuple[type[np.number], str, str]]: ... -def add_newdoc_for_scalar_type(obj: str, fixed_aliases: Iterable[str], doc: str) -> None: ... +def add_newdoc_for_scalar_type(name: str, text_signature: str, doc: str) -> None: ... def _get_platform_and_machine() -> tuple[str, str]: ... diff --git a/src/numpy-stubs/_core/_internal.pyi b/src/numpy-stubs/_core/_internal.pyi index cc4cf3f8..4ca7bd44 100644 --- a/src/numpy-stubs/_core/_internal.pyi +++ b/src/numpy-stubs/_core/_internal.pyi @@ -2,7 +2,7 @@ import ctypes as ct import re from collections.abc import Callable, Iterable from typing import Final, Generic, Self, overload -from typing_extensions import TypeVar, deprecated, override +from typing_extensions import TypeVar, override import _numtype as _nt import numpy as np @@ -49,16 +49,6 @@ class _ctypes(Generic[_PT_co]): def shape_as(self, /, obj: type[_CT]) -> ct.Array[_CT]: ... def strides_as(self, /, obj: type[_CT]) -> ct.Array[_CT]: ... - # - @deprecated('"get_data" is deprecated. Use "data" instead') - def get_data(self, /) -> _PT_co: ... - @deprecated('"get_shape" is deprecated. Use "shape" instead') - def get_shape(self, /) -> ct.Array[c_intp]: ... - @deprecated('"get_strides" is deprecated. Use "strides" instead') - def get_strides(self, /) -> ct.Array[c_intp]: ... - @deprecated('"get_as_parameter" is deprecated. Use "_as_parameter_" instead') - def get_as_parameter(self, /) -> ct.c_void_p: ... - class dummy_ctype(Generic[_T_co]): _cls: type[_T_co] diff --git a/src/numpy-stubs/_core/_machar.pyi b/src/numpy-stubs/_core/_machar.pyi deleted file mode 100644 index 392ca10b..00000000 --- a/src/numpy-stubs/_core/_machar.pyi +++ /dev/null @@ -1,38 +0,0 @@ -from collections.abc import Callable -from typing_extensions import deprecated - -__all__ = ["MachAr"] - -@deprecated("deprecated in numpy 1.22") -class MachAr: - ibeta: int - it: int - machep: int - eps: float - negep: int - epsneg: float - iexp: int - minexp: int - xmin: float - maxexp: int - xmax: float - irnd: int - ngrd: int - epsilon: float - tiny: float - huge: float - precision: float - resolution: float - smallest_normal: float - smallest_subnormal: float - title: str | None - - def __init__( - self, - /, - float_conv: Callable[[int], float] = ..., - int_conv: Callable[[float], int] = ..., - float_to_float: Callable[[float], float] = ..., - float_to_str: Callable[[float], str] = ..., - title: str = "Python floating point number", - ) -> None: ... diff --git a/src/numpy-stubs/_core/_methods.pyi b/src/numpy-stubs/_core/_methods.pyi index 9cd216bc..3c80683f 100644 --- a/src/numpy-stubs/_core/_methods.pyi +++ b/src/numpy-stubs/_core/_methods.pyi @@ -1,14 +1,22 @@ +from collections.abc import Callable +from typing import Any, Concatenate, TypeAlias + import numpy as np -from numpy._core.umath import _Reduce2 -from . import _exceptions as _exceptions, umath as um +from . import _exceptions as _exceptions + +### + +_Reduce2: TypeAlias = Callable[Concatenate[object, ...], Any] + +### bool_dt: np.dtype[np.bool] = ... umr_maximum: _Reduce2 = ... umr_minimum: _Reduce2 = ... umr_sum: _Reduce2 = ... umr_prod: _Reduce2 = ... -umr_bitwise_count = um.bitwise_count +umr_bitwise_count = np.bitwise_count umr_any: _Reduce2 = ... umr_all: _Reduce2 = ... _complex_to_float: dict[np.dtype[np.complexfloating], np.dtype[np.floating]] = ... diff --git a/src/numpy-stubs/_core/_type_aliases.pyi b/src/numpy-stubs/_core/_type_aliases.pyi index ede66f16..86c98c39 100644 --- a/src/numpy-stubs/_core/_type_aliases.pyi +++ b/src/numpy-stubs/_core/_type_aliases.pyi @@ -3,34 +3,37 @@ from typing import Final, Literal as L, TypeAlias, TypedDict, type_check_only import numpy as np -### +sctypeDict: Final[dict[str, type[np.generic]]] = ... +allTypes: Final[dict[str, type[np.generic]]] = ... @type_check_only class _CNamesDict(TypedDict): - BOOL: np.dtypes.BoolDType - BYTE: np.dtypes.ByteDType - UBYTE: np.dtypes.UByteDType - SHORT: np.dtypes.ShortDType - USHORT: np.dtypes.UShortDType - INT: np.dtypes.IntDType - UINT: np.dtypes.UIntDType - LONG: np.dtypes.LongDType - ULONG: np.dtypes.ULongDType - LONGLONG: np.dtypes.LongLongDType - ULONGLONG: np.dtypes.ULongLongDType - HALF: np.dtypes.Float16DType - FLOAT: np.dtypes.Float32DType - DOUBLE: np.dtypes.Float64DType - LONGDOUBLE: np.dtypes.LongDoubleDType - CFLOAT: np.dtypes.Complex64DType - CDOUBLE: np.dtypes.Complex128DType - CLONGDOUBLE: np.dtypes.CLongDoubleDType - STRING: np.dtypes.BytesDType - UNICODE: np.dtypes.StrDType - VOID: np.dtypes.VoidDType - OBJECT: np.dtypes.ObjectDType - DATETIME: np.dtypes.DateTime64DType - TIMEDELTA: np.dtypes.TimeDelta64DType + BOOL: np.dtype[np.bool] + HALF: np.dtype[np.half] + FLOAT: np.dtype[np.single] + DOUBLE: np.dtype[np.double] + LONGDOUBLE: np.dtype[np.longdouble] + CFLOAT: np.dtype[np.csingle] + CDOUBLE: np.dtype[np.cdouble] + CLONGDOUBLE: np.dtype[np.clongdouble] + STRING: np.dtype[np.bytes_] + UNICODE: np.dtype[np.str_] + VOID: np.dtype[np.void] + OBJECT: np.dtype[np.object_] + DATETIME: np.dtype[np.datetime64] + TIMEDELTA: np.dtype[np.timedelta64] + BYTE: np.dtype[np.byte] + UBYTE: np.dtype[np.ubyte] + SHORT: np.dtype[np.short] + USHORT: np.dtype[np.ushort] + INT: np.dtype[np.intc] + UINT: np.dtype[np.uintc] + LONG: np.dtype[np.long] + ULONG: np.dtype[np.ulong] + LONGLONG: np.dtype[np.longlong] + ULONGLONG: np.dtype[np.ulonglong] + +c_names_dict: Final[_CNamesDict] = ... _AbstractTypeName: TypeAlias = L[ "generic", @@ -44,6 +47,7 @@ _AbstractTypeName: TypeAlias = L[ "floating", "complexfloating", ] +_abstract_type_names: Final[set[_AbstractTypeName]] = ... @type_check_only class _AliasesType(TypedDict): @@ -56,6 +60,8 @@ class _AliasesType(TypedDict): int_: L["intp"] uint: L["intp"] +_aliases: Final[_AliasesType] = ... + @type_check_only class _ExtraAliasesType(TypedDict): float: L["float64"] @@ -67,6 +73,8 @@ class _ExtraAliasesType(TypedDict): str: L["str_"] unicode: L["str_"] +_extra_aliases: Final[_ExtraAliasesType] = ... + @type_check_only class _SCTypes(TypedDict): int: Collection[type[np.signedinteger]] @@ -75,29 +83,4 @@ class _SCTypes(TypedDict): complex: Collection[type[np.complexfloating]] others: Collection[type[np.flexible | np.bool | np.object_]] -### - -sctypeDict: Final[dict[str, type[np.generic]]] = ... -allTypes: Final[dict[str, type[np.generic]]] = ... -c_names_dict: Final[_CNamesDict] = ... sctypes: Final[_SCTypes] = ... - -_abstract_type_names: Final[set[_AbstractTypeName]] = ... -_aliases: Final[_AliasesType] = ... -_extra_aliases: Final[_ExtraAliasesType] = ... - -# namespace pollution -k: str -v: str -is_complex: bool -full_name: str -longdouble_type: type[np.longdouble | np.clongdouble] -bits: int -base_name: str -extended_prec_name: str -type_info: np.dtype -type_group: str -concrete_type: type[np.generic] -abstract_type: type[np.generic] -sctype_key: str -sctype_list: list[type[np.generic]] diff --git a/src/numpy-stubs/_core/arrayprint.pyi b/src/numpy-stubs/_core/arrayprint.pyi index 823f28b7..9f1dd987 100644 --- a/src/numpy-stubs/_core/arrayprint.pyi +++ b/src/numpy-stubs/_core/arrayprint.pyi @@ -1,11 +1,9 @@ from collections.abc import Callable from contextlib import _GeneratorContextManager -from typing import Final, Literal, SupportsIndex, TypeAlias, TypedDict, overload, type_check_only -from typing_extensions import deprecated +from typing import Final, Literal, SupportsIndex, TypeAlias, TypedDict, type_check_only import _numtype as _nt import numpy as np -from numpy._globals import _NoValueType from numpy._typing import _CharLike_co, _FloatLike_co __all__ = [ @@ -25,7 +23,6 @@ _FloatMode: TypeAlias = Literal["fixed", "unique", "maxprec", "maxprec_equal"] _Sign: TypeAlias = Literal["-", "+", " "] _Trim: TypeAlias = Literal["k", ".", "0", "-"] _Legacy: TypeAlias = Literal["1.13", "1.21", "1.25", "2.1", False] -_LegacyNoStyle: TypeAlias = Literal["1.21", "1.25", "2.1", False] _ReprFunc: TypeAlias = Callable[[_nt.Array], str] @type_check_only @@ -103,43 +100,6 @@ def printoptions( ) -> _GeneratorContextManager[_FormatOptions]: ... # public numpy export -@overload # no style -def array2string( - a: _nt.Array, - max_line_width: int | None = None, - precision: SupportsIndex | None = None, - suppress_small: bool | None = None, - separator: str = " ", - prefix: str = "", - style: _NoValueType = ..., - formatter: _FormatDict | None = None, - threshold: int | None = None, - edgeitems: int | None = None, - sign: _Sign | None = None, - floatmode: _FloatMode | None = None, - suffix: str = "", - *, - legacy: _Legacy | None = None, -) -> str: ... -@overload # style= (positional), legacy="1.13" -def array2string( - a: _nt.Array, - max_line_width: int | None, - precision: SupportsIndex | None, - suppress_small: bool | None, - separator: str, - prefix: str, - style: _ReprFunc, - formatter: _FormatDict | None = None, - threshold: int | None = None, - edgeitems: int | None = None, - sign: _Sign | None = None, - floatmode: _FloatMode | None = None, - suffix: str = "", - *, - legacy: Literal["1.13"], -) -> str: ... -@overload # style= (keyword), legacy="1.13" def array2string( a: _nt.Array, max_line_width: int | None = None, @@ -148,52 +108,13 @@ def array2string( separator: str = " ", prefix: str = "", *, - style: _ReprFunc, formatter: _FormatDict | None = None, threshold: int | None = None, edgeitems: int | None = None, sign: _Sign | None = None, floatmode: _FloatMode | None = None, suffix: str = "", - legacy: Literal["1.13"], -) -> str: ... -@overload # style= (positional), legacy!="1.13" -@deprecated("'style' argument is deprecated and no longer functional except in 1.13 'legacy' mode") -def array2string( - a: _nt.Array, - max_line_width: int | None, - precision: SupportsIndex | None, - suppress_small: bool | None, - separator: str, - prefix: str, - style: _ReprFunc, - formatter: _FormatDict | None = None, - threshold: int | None = None, - edgeitems: int | None = None, - sign: _Sign | None = None, - floatmode: _FloatMode | None = None, - suffix: str = "", - *, - legacy: _LegacyNoStyle | None = None, -) -> str: ... -@overload # style= (keyword), legacy="1.13" -@deprecated("'style' argument is deprecated and no longer functional except in 1.13 'legacy' mode") -def array2string( - a: _nt.Array, - max_line_width: int | None = None, - precision: SupportsIndex | None = None, - suppress_small: bool | None = None, - separator: str = " ", - prefix: str = "", - *, - style: _ReprFunc, - formatter: _FormatDict | None = None, - threshold: int | None = None, - edgeitems: int | None = None, - sign: _Sign | None = None, - floatmode: _FloatMode | None = None, - suffix: str = "", - legacy: _LegacyNoStyle | None = None, + legacy: _Legacy | None = None, ) -> str: ... # public numpy export diff --git a/src/numpy-stubs/_core/defchararray.pyi b/src/numpy-stubs/_core/defchararray.pyi index 9f05e50c..5045655a 100644 --- a/src/numpy-stubs/_core/defchararray.pyi +++ b/src/numpy-stubs/_core/defchararray.pyi @@ -4,7 +4,7 @@ from typing_extensions import Buffer, TypeAliasType, TypeVar, override import _numtype as _nt import numpy as np -from numpy import _OrderKACF as _Order, _SortKind # noqa: ICN003 +from numpy import _OrderKACF as _Order # noqa: ICN003 from numpy._typing import ( _ArrayLikeAnyString_co as _ToAnyCharND, _ArrayLikeString_co as _ToStringND, @@ -224,17 +224,6 @@ class chararray(np.ndarray[_ShapeT_co, _DTypeT_co]): @override def __rmod__(self: Never, rhs: Never, /) -> Any: ... # type: ignore[misc, override] # pyright: ignore[reportIncompatibleMethodOverride] - # - @override # type: ignore[override] - @overload - def argsort( - self, /, axis: SupportsIndex = -1, kind: _SortKind | None = None, order: None = None - ) -> _nt.Array[np.intp, _ShapeT_co]: ... - @overload - def argsort( # pyright: ignore[reportIncompatibleMethodOverride] - self, /, axis: None, kind: _SortKind | None = None, order: None = None - ) -> _nt.Array1D[np.intp]: ... - # def decode( self: _BytesArray, /, encoding: str | None = None, errors: str | None = None diff --git a/src/numpy-stubs/_core/fromnumeric.pyi b/src/numpy-stubs/_core/fromnumeric.pyi index 12cd0429..467bee9c 100644 --- a/src/numpy-stubs/_core/fromnumeric.pyi +++ b/src/numpy-stubs/_core/fromnumeric.pyi @@ -1,7 +1,7 @@ from _typeshed import Incomplete from collections.abc import Sequence from typing import Any, Literal as L, Protocol, SupportsIndex as CanIndex, TypeAlias, overload, type_check_only -from typing_extensions import TypeVar, TypedDict, Unpack, deprecated +from typing_extensions import TypeVar, TypedDict, Unpack import _numtype as _nt import numpy as np @@ -147,56 +147,27 @@ def choose( # @overload # shape: index def reshape( - a: _nt._ToArray_nd[_ScalarT], - /, - shape: CanIndex, - order: _OrderACF = "C", - *, - newshape: None = None, - copy: bool | None = None, + a: _nt._ToArray_nd[_ScalarT], /, shape: CanIndex, order: _OrderACF = "C", *, copy: bool | None = None ) -> _nt.Array1D[_ScalarT]: ... @overload # shape: _AnyShape def reshape( - a: _nt._ToArray_nd[_ScalarT], - /, - shape: _AnyShapeT, - order: _OrderACF = "C", - *, - newshape: None = None, - copy: bool | None = None, + a: _nt._ToArray_nd[_ScalarT], /, shape: _AnyShapeT, order: _OrderACF = "C", *, copy: bool | None = None ) -> _nt.Array[_ScalarT, _AnyShapeT]: ... @overload # shape: Sequence[index] def reshape( - a: _nt._ToArray_nd[_ScalarT], - /, - shape: Sequence[CanIndex], - order: _OrderACF = "C", - *, - newshape: None = None, - copy: bool | None = None, + a: _nt._ToArray_nd[_ScalarT], /, shape: Sequence[CanIndex], order: _OrderACF = "C", *, copy: bool | None = None ) -> _nt.Array[_ScalarT]: ... @overload # shape: index def reshape( - a: ArrayLike, /, shape: CanIndex, order: _OrderACF = "C", *, newshape: None = None, copy: bool | None = None + a: ArrayLike, /, shape: CanIndex, order: _OrderACF = "C", *, copy: bool | None = None ) -> _nt.Array1D[Incomplete]: ... @overload def reshape( # shape: _AnyShape - a: ArrayLike, /, shape: _AnyShapeT, order: _OrderACF = "C", *, newshape: None = None, copy: bool | None = None + a: ArrayLike, /, shape: _AnyShapeT, order: _OrderACF = "C", *, copy: bool | None = None ) -> _nt.Array[Incomplete, _AnyShapeT]: ... @overload # shape: Sequence[index] def reshape( - a: ArrayLike, - /, - shape: Sequence[CanIndex], - order: _OrderACF = "C", - *, - newshape: None = None, - copy: bool | None = None, -) -> _nt.Array[Incomplete]: ... -@overload -@deprecated("`newshape` is deprecated, `shape` instead. (deprecated in NumPy 2.1)") -def reshape( - a: ArrayLike, /, shape: None = None, order: _OrderACF = "C", *, newshape: _ShapeLike, copy: bool | None = None + a: ArrayLike, /, shape: Sequence[CanIndex], order: _OrderACF = "C", *, copy: bool | None = None ) -> _nt.Array[Incomplete]: ... # diff --git a/src/numpy-stubs/_core/getlimits.pyi b/src/numpy-stubs/_core/getlimits.pyi index f5deb6c8..0c1bad9b 100644 --- a/src/numpy-stubs/_core/getlimits.pyi +++ b/src/numpy-stubs/_core/getlimits.pyi @@ -1,3 +1,4 @@ +from functools import cached_property from types import GenericAlias from typing import Final, Generic, Literal as L, Self, overload from typing_extensions import TypeVar @@ -51,28 +52,26 @@ class iinfo(Generic[_IntegerT_co]): # class finfo(Generic[_FloatingT_co]): - dtype: np.dtype[_FloatingT_co] - eps: _FloatingT_co - epsneg: _FloatingT_co - resolution: _FloatingT_co - smallest_subnormal: _FloatingT_co - max: _FloatingT_co - min: _FloatingT_co + dtype: np.dtype[_FloatingT_co] # readonly + eps: _FloatingT_co # readonly + _radix: _FloatingT_co # readonly + smallest_normal: _FloatingT_co # readonly + smallest_subnormal: _FloatingT_co # readonly + max: _FloatingT_co # readonly + min: _FloatingT_co # readonly - bits: Final[L[2, 4, 8, 12, 16]] - iexp: Final[int] - machep: Final[int] + _fmt: str | None # `__str__` cache + _repr: str | None # `__repr__` cache + + bits: Final[int] maxexp: Final[int] minexp: Final[int] - negep: Final[int] - nexp: Final[int] nmant: Final[int] precision: Final[int] - @property - def smallest_normal(self, /) -> _FloatingT_co: ... - @property - def tiny(self, /) -> _FloatingT_co: ... + # + @classmethod + def __class_getitem__(cls, item: object, /) -> GenericAlias: ... # @overload @@ -87,5 +86,17 @@ class finfo(Generic[_FloatingT_co]): def __new__(cls, dtype: _FloatingT_co | _nt._ToDType[_FloatingT_co]) -> Self: ... # - @classmethod - def __class_getitem__(cls, item: object, /) -> GenericAlias: ... + @cached_property + def epsneg(self, /) -> _FloatingT_co: ... + @cached_property + def resolution(self, /) -> _FloatingT_co: ... + @cached_property + def machep(self, /) -> int: ... + @cached_property + def negep(self, /) -> int: ... + @cached_property + def nexp(self, /) -> int: ... + @cached_property + def iexp(self, /) -> int: ... + @cached_property + def tiny(self, /) -> _FloatingT_co: ... diff --git a/src/numpy-stubs/_core/strings.pyi b/src/numpy-stubs/_core/strings.pyi index 4f29ba39..15c03c1d 100644 --- a/src/numpy-stubs/_core/strings.pyi +++ b/src/numpy-stubs/_core/strings.pyi @@ -2,6 +2,7 @@ from typing import TypeAlias, overload import _numtype as _nt import numpy as np +from numpy._globals import _NoValueType from numpy._typing import _ArrayLikeAnyString_co as ToAnyStringND, _ArrayLikeInt_co as ToIntND from .umath import ( @@ -245,7 +246,7 @@ def translate(a: _nt.ToString_nd, table: str, deletechars: str | None = None) -> def slice( a: _nt.ToStr_nd, start: _nt.ToInteger_nd | None = None, - stop: _nt.ToInteger_nd | None = None, + stop: _nt.ToInteger_nd | _NoValueType = ..., step: _nt.ToInteger_nd | None = None, /, ) -> _StrND: ... @@ -253,7 +254,7 @@ def slice( def slice( a: _nt.ToBytes_nd, start: _nt.ToInteger_nd | None = None, - stop: _nt.ToInteger_nd | None = None, + stop: _nt.ToInteger_nd | _NoValueType = ..., step: _nt.ToInteger_nd | None = None, /, ) -> _BytesND: ... @@ -261,7 +262,7 @@ def slice( def slice( a: _nt.ToString_nd, start: _nt.ToInteger_nd | None = None, - stop: _nt.ToInteger_nd | None = None, + stop: _nt.ToInteger_nd | _NoValueType = ..., step: _nt.ToInteger_nd | None = None, /, ) -> _nt.StringArray: ... diff --git a/src/numpy-stubs/_core/umath.pyi b/src/numpy-stubs/_core/umath.pyi index d0dcd422..c77b7221 100644 --- a/src/numpy-stubs/_core/umath.pyi +++ b/src/numpy-stubs/_core/umath.pyi @@ -102,6 +102,7 @@ __all__ = [ "logical_not", "logical_or", "logical_xor", + "matmul", "matvec", "maximum", "minimum", diff --git a/src/numpy-stubs/core/umath.pyi b/src/numpy-stubs/core/umath.pyi index 293e4306..5383b7e5 100644 --- a/src/numpy-stubs/core/umath.pyi +++ b/src/numpy-stubs/core/umath.pyi @@ -63,6 +63,7 @@ from numpy._core.umath import ( logical_not, logical_or, logical_xor, + matmul, matvec, maximum, minimum, @@ -162,6 +163,7 @@ __all__ = [ "logical_not", "logical_or", "logical_xor", + "matmul", "matvec", "maximum", "minimum", diff --git a/tool/allowlists/todo.txt b/tool/allowlists/todo.txt index bfa3eb42..59c630a5 100644 --- a/tool/allowlists/todo.txt +++ b/tool/allowlists/todo.txt @@ -1,60 +1,6 @@ -numpy._core._add_newdocs.refer_to_array_attribute -numpy._core._add_newdocs_scalars.add_newdoc_for_scalar_type -numpy._core._add_newdocs_scalars.bool_name -numpy._core._internal._ctypes.get_as_parameter -numpy._core._internal._ctypes.get_data -numpy._core._internal._ctypes.get_shape -numpy._core._internal._ctypes.get_strides -numpy._core._machar -numpy._core._methods.umr_all -numpy._core._methods.umr_any -numpy._core._methods.umr_maximum -numpy._core._methods.umr_minimum -numpy._core._methods.umr_prod -numpy._core._methods.umr_sum -numpy._core._type_aliases.abstract_type -numpy._core._type_aliases.base_name -numpy._core._type_aliases.bits -numpy._core._type_aliases.concrete_type -numpy._core._type_aliases.extended_prec_name -numpy._core._type_aliases.full_name -numpy._core._type_aliases.is_complex -numpy._core._type_aliases.k -numpy._core._type_aliases.longdouble_type -numpy._core._type_aliases.sctype_key -numpy._core._type_aliases.sctype_list -numpy._core._type_aliases.type_group -numpy._core._type_aliases.type_info -numpy._core._type_aliases.v -numpy._core.array2string -numpy._core.arrayprint.array2string -numpy._core.defchararray.chararray.argsort -numpy._core.finfo.smallest_normal -numpy._core.fromnumeric.reshape -numpy._core.getlimits.finfo.smallest_normal -numpy._core.numeric.array2string -numpy._core.numeric.reshape -numpy._core.reshape -numpy._core.strings.slice -numpy._core.umath.__all__ -numpy.array2string -numpy.char.chararray.argsort -numpy.core._internal._ctypes.get_as_parameter -numpy.core._internal._ctypes.get_data -numpy.core._internal._ctypes.get_shape -numpy.core._internal._ctypes.get_strides -numpy.core.arrayprint.array2string -numpy.core.defchararray.chararray.argsort -numpy.core.fromnumeric.reshape -numpy.core.getlimits.finfo.smallest_normal -numpy.core.numeric.array2string -numpy.core.numeric.reshape -numpy.core.umath.__all__ -numpy.core.umath.matmul numpy.corrcoef numpy.f2py._backends._meson.MesonTemplate.objects_substitution numpy.fft.helper -numpy.finfo.smallest_normal numpy.in1d numpy.lib._arraysetops_impl.__all__ numpy.lib._arraysetops_impl.in1d @@ -178,20 +124,15 @@ numpy.ma.var numpy.ma.vstack numpy.ma.zeros numpy.ma.zeros_like -numpy.matlib.array2string numpy.matlib.corrcoef -numpy.matlib.finfo.smallest_normal numpy.matlib.in1d numpy.matlib.nanpercentile numpy.matlib.ndindex.ndincr numpy.matlib.percentile -numpy.matlib.reshape numpy.matlib.save numpy.matlib.trapz numpy.nanpercentile numpy.ndindex.ndincr numpy.percentile -numpy.reshape numpy.save -numpy.strings.slice numpy.trapz