Skip to content

Commit 5caff29

Browse files
committed
🏷️ fix stubtest error for numpy.ma.alltrue
1 parent 315b559 commit 5caff29

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/numpy-stubs/ma/core.pyi

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from _typeshed import Incomplete
2-
from collections.abc import Callable
3-
from typing import Any, ClassVar, Final, Generic, Literal as L, type_check_only
2+
from typing import Any, ClassVar, Final, Generic, Literal as L, SupportsIndex as CanIndex, TypeAlias, type_check_only
43
from typing_extensions import Never, Self, TypeVar, deprecated, overload
54

65
import numpy as np
76
from _numtype import Array, ToGeneric_0d, ToGeneric_1nd, ToGeneric_nd
87
from numpy import _OrderACF, _OrderKACF, amax, amin, angle, bool_, clip, expand_dims, indices, squeeze # noqa: ICN003
8+
from numpy._typing import _BoolCodes
99

1010
__all__ = [
1111
"MAError",
@@ -194,6 +194,8 @@ _ShapeT_co = TypeVar("_ShapeT_co", bound=tuple[int, ...], default=tuple[int, ...
194194
_DTypeT = TypeVar("_DTypeT", bound=np.dtype[Any])
195195
_DTypeT_co = TypeVar("_DTypeT_co", bound=np.dtype[Any], default=np.dtype[Any], covariant=True)
196196

197+
_DTypeLikeBool: TypeAlias = type[bool | np.bool] | np.dtype[np.bool] | _BoolCodes
198+
197199
###
198200

199201
MaskType: Final[type[np.bool]] = ...
@@ -912,9 +914,9 @@ greater_equal: _MaskedBinaryOperation
912914
less: _MaskedBinaryOperation
913915
greater: _MaskedBinaryOperation
914916
logical_and: _MaskedBinaryOperation
915-
alltrue: _MaskedBinaryOperation
917+
def alltrue(target: ToGeneric_nd, axis: CanIndex | None = 0, dtype: _DTypeLikeBool | None = None) -> Incomplete: ...
916918
logical_or: _MaskedBinaryOperation
917-
sometrue: Callable[..., Incomplete]
919+
def sometrue(target: ToGeneric_nd, axis: CanIndex | None = 0, dtype: _DTypeLikeBool | None = None) -> Incomplete: ...
918920
logical_xor: _MaskedBinaryOperation
919921
bitwise_and: _MaskedBinaryOperation
920922
bitwise_or: _MaskedBinaryOperation

tool/.mypyignore-todo.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ numpy.f2py.symbolic
2222
numpy.f2py.((cb|common|f90mod|use)_)?rules
2323

2424
numpy.ma.testutils
25-
numpy.ma(.core)?.alltrue
2625
numpy.ma(.core)?.angle
2726
numpy.ma(.core)?.clip
2827
numpy.ma(.core)?.(arg)?sort

0 commit comments

Comments
 (0)