1
- from collections .abc import Callable
2
- from typing import Any , TypeVar
3
-
4
- from numpy import (
5
- amax ,
6
- amin ,
7
- bool_ ,
8
- expand_dims ,
9
- clip ,
10
- indices ,
11
- squeeze ,
12
- angle ,
13
- ndarray ,
14
- dtype ,
15
- float64 ,
16
- )
1
+ # pyright: reportIncompatibleMethodOverride=false
2
+ # ruff: noqa: ANN001, ANN002, ANN003, ANN201, ANN202 ANN204
3
+
4
+ from typing import Any , SupportsIndex , TypeVar
5
+
6
+ from _typeshed import Incomplete
7
+ from typing_extensions import deprecated
8
+
9
+ from numpy import _OrderKACF , amax , amin , bool_ , dtype , expand_dims , float64 , ndarray
10
+ from numpy ._typing import ArrayLike , _DTypeLikeBool
17
11
18
12
__all__ = [
19
13
"MAError" ,
@@ -111,8 +105,8 @@ __all__ = [
111
105
"less" ,
112
106
"less_equal" ,
113
107
"log" ,
114
- "log10" ,
115
108
"log2" ,
109
+ "log10" ,
116
110
"logical_and" ,
117
111
"logical_not" ,
118
112
"logical_or" ,
@@ -256,6 +250,7 @@ cosh: _MaskedUnaryOperation
256
250
tanh : _MaskedUnaryOperation
257
251
abs : _MaskedUnaryOperation
258
252
absolute : _MaskedUnaryOperation
253
+ angle : _MaskedUnaryOperation
259
254
fabs : _MaskedUnaryOperation
260
255
negative : _MaskedUnaryOperation
261
256
floor : _MaskedUnaryOperation
@@ -283,20 +278,21 @@ greater_equal: _MaskedBinaryOperation
283
278
less : _MaskedBinaryOperation
284
279
greater : _MaskedBinaryOperation
285
280
logical_and : _MaskedBinaryOperation
286
- alltrue : _MaskedBinaryOperation
281
+ def alltrue ( target : ArrayLike , axis : SupportsIndex | None = 0 , dtype : _DTypeLikeBool | None = None ) -> Incomplete : ...
287
282
logical_or : _MaskedBinaryOperation
288
- sometrue : Callable [ ..., Any ]
283
+ def sometrue ( target : ArrayLike , axis : SupportsIndex | None = 0 , dtype : _DTypeLikeBool | None = None ) -> Incomplete : ...
289
284
logical_xor : _MaskedBinaryOperation
290
285
bitwise_and : _MaskedBinaryOperation
291
286
bitwise_or : _MaskedBinaryOperation
292
287
bitwise_xor : _MaskedBinaryOperation
293
288
hypot : _MaskedBinaryOperation
294
- divide : _MaskedBinaryOperation
295
- true_divide : _MaskedBinaryOperation
296
- floor_divide : _MaskedBinaryOperation
297
- remainder : _MaskedBinaryOperation
298
- fmod : _MaskedBinaryOperation
299
- mod : _MaskedBinaryOperation
289
+
290
+ divide : _DomainedBinaryOperation
291
+ true_divide : _DomainedBinaryOperation
292
+ floor_divide : _DomainedBinaryOperation
293
+ remainder : _DomainedBinaryOperation
294
+ fmod : _DomainedBinaryOperation
295
+ mod : _DomainedBinaryOperation
300
296
301
297
def make_mask_descr (ndtype ): ...
302
298
def getmask (a ): ...
@@ -447,16 +443,17 @@ class MaskedArray(ndarray[_ShapeType_co, _DType_co]):
447
443
def var (self , axis = ..., dtype = ..., out = ..., ddof = ..., keepdims = ...): ...
448
444
def std (self , axis = ..., dtype = ..., out = ..., ddof = ..., keepdims = ...): ...
449
445
def round (self , decimals = ..., out = ...): ...
450
- def argsort (self , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., stable = ...): ...
446
+ def argsort (self , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., * , stable = ...): ...
451
447
def argmin (self , axis = ..., fill_value = ..., out = ..., * , keepdims = ...): ...
452
448
def argmax (self , axis = ..., fill_value = ..., out = ..., * , keepdims = ...): ...
453
- def sort (self , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., stable = ...): ...
449
+ def sort (self , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., * , stable = ...): ...
454
450
def min (self , axis = ..., out = ..., fill_value = ..., keepdims = ...): ...
455
451
def max (self , axis = ..., out = ..., fill_value = ..., keepdims = ...): ...
456
452
def ptp (self , axis = ..., out = ..., fill_value = ..., keepdims = ...): ...
457
453
def partition (self , * args , ** kwargs ): ...
458
454
def argpartition (self , * args , ** kwargs ): ...
459
455
def take (self , indices , axis = ..., out = ..., mode = ...): ...
456
+
460
457
copy : Any
461
458
diagonal : Any
462
459
flatten : Any
@@ -465,19 +462,26 @@ class MaskedArray(ndarray[_ShapeType_co, _DType_co]):
465
462
swapaxes : Any
466
463
T : Any
467
464
transpose : Any
465
+
468
466
@property # type: ignore[misc]
469
467
def mT (self ): ...
470
- def tolist (self , fill_value = ...): ...
471
- def tobytes (self , fill_value = ..., order = ...): ...
472
- def tofile (self , fid , sep = ..., format = ...): ...
473
- def toflex (self ): ...
474
- torecords : Any
468
+
469
+ #
470
+ def toflex (self ) -> Incomplete : ...
471
+ def torecords (self ) -> Incomplete : ...
472
+ def tolist (self , fill_value : Incomplete | None = None ) -> Incomplete : ...
473
+ @deprecated ("tostring() is deprecated. Use tobytes() instead." )
474
+ def tostring (self , / , fill_value : Incomplete | None = None , order : _OrderKACF = "C" ) -> bytes : ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
475
+ def tobytes (self , / , fill_value : Incomplete | None = None , order : _OrderKACF = "C" ) -> bytes : ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
476
+ def tofile (self , / , fid : Incomplete , sep : str = "" , format : str = "%s" ) -> Incomplete : ...
477
+
478
+ #
475
479
def __reduce__ (self ): ...
476
480
def __deepcopy__ (self , memo = ...): ...
477
481
478
482
class mvoid (MaskedArray [_ShapeType_co , _DType_co ]):
479
483
def __new__ (
480
- self ,
484
+ self , # pyright: ignore[reportSelfClsParameterName]
481
485
data ,
482
486
mask = ...,
483
487
dtype = ...,
@@ -590,8 +594,8 @@ maximum: _extrema_operation
590
594
591
595
def take (a , indices , axis = ..., out = ..., mode = ...): ...
592
596
def power (a , b , third = ...): ...
593
- def argsort (a , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., stable = ...): ...
594
- def sort (a , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., stable = ...): ...
597
+ def argsort (a , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., * , stable = ...): ...
598
+ def sort (a , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., * , stable = ...): ...
595
599
def compressed (x ): ...
596
600
def concatenate (arrays , axis = ...): ...
597
601
def diag (v , k = ...): ...
@@ -626,19 +630,21 @@ def asanyarray(a, dtype=...): ...
626
630
def fromflex (fxarray ): ...
627
631
628
632
class _convert2ma :
629
- __doc__ : Any
630
- def __init__ (self , funcname , params = ...): ...
631
- def getdoc (self ): ...
632
- def __call__ (self , * args , ** params ): ...
633
+ def __init__ (self , / , funcname : str , np_ret : str , np_ma_ret : str , params : dict [str , Any ] | None = None ) -> None : ...
634
+ def __call__ (self , / , * args : object , ** params : object ) -> Any : ... # noqa: ANN401
635
+ def getdoc (self , / , np_ret : str , np_ma_ret : str ) -> str | None : ...
633
636
634
637
arange : _convert2ma
638
+ clip : _convert2ma
635
639
empty : _convert2ma
636
640
empty_like : _convert2ma
637
641
frombuffer : _convert2ma
638
642
fromfunction : _convert2ma
639
643
identity : _convert2ma
644
+ indices : _convert2ma
640
645
ones : _convert2ma
641
646
ones_like : _convert2ma
647
+ squeeze : _convert2ma
642
648
zeros : _convert2ma
643
649
zeros_like : _convert2ma
644
650
0 commit comments