Skip to content

Commit c77a7be

Browse files
committed
🎨 refactor from _numtype import in ma
1 parent ed05804 commit c77a7be

1 file changed

Lines changed: 12 additions & 10 deletions

File tree

‎src/numpy-stubs/ma/core.pyi‎

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ from _typeshed import Incomplete
22
from typing import Any, ClassVar, Final, Generic, Literal as L, SupportsIndex as CanIndex, TypeAlias, type_check_only
33
from typing_extensions import Never, Self, TypeVar, deprecated, overload, override
44

5+
import _numtype as _nt
56
import numpy as np
6-
from _numtype import Array, ToGeneric_0d, ToGeneric_1nd, ToGeneric_nd
77
from numpy import _OrderACF, _OrderKACF, amax, amin, bool_, expand_dims # noqa: ICN003
88
from numpy._globals import _NoValueType
99
from numpy._typing import ArrayLike, _ArrayLike, _BoolCodes, _ScalarLike_co, _ShapeLike
@@ -197,12 +197,12 @@ _ShapeT_co = TypeVar("_ShapeT_co", bound=tuple[int, ...], default=tuple[int, ...
197197
_DTypeT = TypeVar("_DTypeT", bound=np.dtype)
198198
_DTypeT_co = TypeVar("_DTypeT_co", bound=np.dtype, default=np.dtype, covariant=True)
199199

200-
_DTypeLikeBool: TypeAlias = type[bool | np.bool] | np.dtype[np.bool] | _BoolCodes
200+
_DTypeLikeBool: TypeAlias = type[bool | np.bool_] | np.dtype[np.bool_] | _BoolCodes
201201

202202
###
203203

204-
MaskType: Final[type[np.bool]] = ...
205-
nomask: np.bool[L[False]] = ...
204+
MaskType: Final[type[np.bool_]] = ...
205+
nomask: np.bool_[L[False]] = ...
206206
masked_print_option: Final[_MaskedPrintOption] = ...
207207

208208
###
@@ -216,9 +216,9 @@ class MaskError(MAError): ...
216216
@type_check_only
217217
class _DomainBase:
218218
@overload
219-
def __call__(self, /, x: ToGeneric_0d) -> np.bool: ...
219+
def __call__(self, /, x: _nt.ToGeneric_0d) -> np.bool_: ...
220220
@overload
221-
def __call__(self, /, x: ToGeneric_1nd) -> Array[np.bool]: ...
221+
def __call__(self, /, x: _nt.ToGeneric_1nd) -> _nt.Array[np.bool_]: ...
222222

223223
class _DomainCheckInterval(_DomainBase):
224224
a: Final[float]
@@ -240,7 +240,7 @@ class _DomainGreaterEqual(_DomainBase):
240240
class _DomainSafeDivide:
241241
tolerance: float
242242
def __init__(self, /, tolerance: float | None = None) -> None: ...
243-
def __call__(self, /, a: ToGeneric_nd, b: ToGeneric_nd) -> Array[Incomplete]: ...
243+
def __call__(self, /, a: _nt.ToGeneric_nd, b: _nt.ToGeneric_nd) -> _nt.Array[Incomplete]: ...
244244

245245
###
246246

@@ -332,7 +332,7 @@ class MaskedArray(np.ndarray[_ShapeT_co, _DTypeT_co]):
332332

333333
#
334334
@property
335-
def recordmask(self) -> Array[np.bool]: ...
335+
def recordmask(self) -> _nt.Array[np.bool_]: ...
336336
@recordmask.setter
337337
def recordmask(self, mask: Never, /) -> None: ...
338338

@@ -1040,11 +1040,13 @@ less: _MaskedBinaryOperation
10401040
greater: _MaskedBinaryOperation
10411041
logical_and: _MaskedBinaryOperation
10421042

1043-
def alltrue(target: ToGeneric_nd, axis: CanIndex | None = 0, dtype: _DTypeLikeBool | None = None) -> Incomplete: ...
1043+
def alltrue(target: _nt.ToGeneric_nd, axis: CanIndex | None = 0, dtype: _DTypeLikeBool | None = None) -> Incomplete: ...
10441044

10451045
logical_or: _MaskedBinaryOperation
10461046

1047-
def sometrue(target: ToGeneric_nd, axis: CanIndex | None = 0, dtype: _DTypeLikeBool | None = None) -> Incomplete: ...
1047+
def sometrue(
1048+
target: _nt.ToGeneric_nd, axis: CanIndex | None = 0, dtype: _DTypeLikeBool | None = None
1049+
) -> Incomplete: ...
10481050

10491051
logical_xor: _MaskedBinaryOperation
10501052
bitwise_and: _MaskedBinaryOperation

0 commit comments

Comments
 (0)