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" ,
@@ -257,6 +251,7 @@ cosh: _MaskedUnaryOperation
257
251
tanh : _MaskedUnaryOperation
258
252
abs : _MaskedUnaryOperation
259
253
absolute : _MaskedUnaryOperation
254
+ angle : _MaskedUnaryOperation
260
255
fabs : _MaskedUnaryOperation
261
256
negative : _MaskedUnaryOperation
262
257
floor : _MaskedUnaryOperation
@@ -284,20 +279,21 @@ greater_equal: _MaskedBinaryOperation
284
279
less : _MaskedBinaryOperation
285
280
greater : _MaskedBinaryOperation
286
281
logical_and : _MaskedBinaryOperation
287
- alltrue : _MaskedBinaryOperation
282
+ def alltrue ( target : ArrayLike , axis : SupportsIndex | None = 0 , dtype : _DTypeLikeBool | None = None ) -> Incomplete : ...
288
283
logical_or : _MaskedBinaryOperation
289
- sometrue : Callable [ ..., Any ]
284
+ def sometrue ( target : ArrayLike , axis : SupportsIndex | None = 0 , dtype : _DTypeLikeBool | None = None ) -> Incomplete : ...
290
285
logical_xor : _MaskedBinaryOperation
291
286
bitwise_and : _MaskedBinaryOperation
292
287
bitwise_or : _MaskedBinaryOperation
293
288
bitwise_xor : _MaskedBinaryOperation
294
289
hypot : _MaskedBinaryOperation
295
- divide : _MaskedBinaryOperation
296
- true_divide : _MaskedBinaryOperation
297
- floor_divide : _MaskedBinaryOperation
298
- remainder : _MaskedBinaryOperation
299
- fmod : _MaskedBinaryOperation
300
- mod : _MaskedBinaryOperation
290
+
291
+ divide : _DomainedBinaryOperation
292
+ true_divide : _DomainedBinaryOperation
293
+ floor_divide : _DomainedBinaryOperation
294
+ remainder : _DomainedBinaryOperation
295
+ fmod : _DomainedBinaryOperation
296
+ mod : _DomainedBinaryOperation
301
297
302
298
def make_mask_descr (ndtype ): ...
303
299
def getmask (a ): ...
@@ -448,10 +444,10 @@ class MaskedArray(ndarray[_ShapeType_co, _DType_co]):
448
444
def var (self , axis = ..., dtype = ..., out = ..., ddof = ..., keepdims = ...): ...
449
445
def std (self , axis = ..., dtype = ..., out = ..., ddof = ..., keepdims = ...): ...
450
446
def round (self , decimals = ..., out = ...): ...
451
- def argsort (self , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., stable = ...): ...
447
+ def argsort (self , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., * , stable = ...): ...
452
448
def argmin (self , axis = ..., fill_value = ..., out = ..., * , keepdims = ...): ...
453
449
def argmax (self , axis = ..., fill_value = ..., out = ..., * , keepdims = ...): ...
454
- def sort (self , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., stable = ...): ...
450
+ def sort (self , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., * , stable = ...): ...
455
451
def min (self , axis = ..., out = ..., fill_value = ..., keepdims = ...): ...
456
452
# NOTE: deprecated
457
453
# def tostring(self, fill_value=..., order=...): ...
@@ -460,6 +456,7 @@ class MaskedArray(ndarray[_ShapeType_co, _DType_co]):
460
456
def partition (self , * args , ** kwargs ): ...
461
457
def argpartition (self , * args , ** kwargs ): ...
462
458
def take (self , indices , axis = ..., out = ..., mode = ...): ...
459
+
463
460
copy : Any
464
461
diagonal : Any
465
462
flatten : Any
@@ -468,19 +465,26 @@ class MaskedArray(ndarray[_ShapeType_co, _DType_co]):
468
465
swapaxes : Any
469
466
T : Any
470
467
transpose : Any
468
+
471
469
@property # type: ignore[misc]
472
470
def mT (self ): ...
473
- def tolist (self , fill_value = ...): ...
474
- def tobytes (self , fill_value = ..., order = ...): ...
475
- def tofile (self , fid , sep = ..., format = ...): ...
476
- def toflex (self ): ...
477
- torecords : Any
471
+
472
+ #
473
+ def toflex (self ) -> Incomplete : ...
474
+ def torecords (self ) -> Incomplete : ...
475
+ def tolist (self , fill_value : Incomplete | None = None ) -> Incomplete : ...
476
+ @deprecated ("tostring() is deprecated. Use tobytes() instead." )
477
+ def tostring (self , / , fill_value : Incomplete | None = None , order : _OrderKACF = "C" ) -> bytes : ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
478
+ def tobytes (self , / , fill_value : Incomplete | None = None , order : _OrderKACF = "C" ) -> bytes : ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
479
+ def tofile (self , / , fid : Incomplete , sep : str = "" , format : str = "%s" ) -> Incomplete : ...
480
+
481
+ #
478
482
def __reduce__ (self ): ...
479
483
def __deepcopy__ (self , memo = ...): ...
480
484
481
485
class mvoid (MaskedArray [_ShapeType_co , _DType_co ]):
482
486
def __new__ (
483
- self ,
487
+ self , # pyright: ignore[reportSelfClsParameterName]
484
488
data ,
485
489
mask = ...,
486
490
dtype = ...,
@@ -593,8 +597,8 @@ maximum: _extrema_operation
593
597
594
598
def take (a , indices , axis = ..., out = ..., mode = ...): ...
595
599
def power (a , b , third = ...): ...
596
- def argsort (a , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., stable = ...): ...
597
- def sort (a , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., stable = ...): ...
600
+ def argsort (a , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., * , stable = ...): ...
601
+ def sort (a , axis = ..., kind = ..., order = ..., endwith = ..., fill_value = ..., * , stable = ...): ...
598
602
def compressed (x ): ...
599
603
def concatenate (arrays , axis = ...): ...
600
604
def diag (v , k = ...): ...
@@ -629,19 +633,21 @@ def asanyarray(a, dtype=...): ...
629
633
def fromflex (fxarray ): ...
630
634
631
635
class _convert2ma :
632
- __doc__ : Any
633
- def __init__ (self , funcname , params = ...): ...
634
- def getdoc (self ): ...
635
- def __call__ (self , * args , ** params ): ...
636
+ def __init__ (self , / , funcname : str , np_ret : str , np_ma_ret : str , params : dict [str , Any ] | None = None ) -> None : ...
637
+ def __call__ (self , / , * args : object , ** params : object ) -> Any : ... # noqa: ANN401
638
+ def getdoc (self , / , np_ret : str , np_ma_ret : str ) -> str | None : ...
636
639
637
640
arange : _convert2ma
641
+ clip : _convert2ma
638
642
empty : _convert2ma
639
643
empty_like : _convert2ma
640
644
frombuffer : _convert2ma
641
645
fromfunction : _convert2ma
642
646
identity : _convert2ma
647
+ indices : _convert2ma
643
648
ones : _convert2ma
644
649
ones_like : _convert2ma
650
+ squeeze : _convert2ma
645
651
zeros : _convert2ma
646
652
zeros_like : _convert2ma
647
653
0 commit comments