-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
TYP: Type MaskedArray.__{add,radd,sub,rsub}__
#29012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -368,3 +382,243 @@ assert_type(MAR_2d_f4.T, np.ma.MaskedArray[tuple[int, int], np.dtype[np.float32] | |||
|
|||
assert_type(MAR_2d_f4.nonzero(), tuple[_Array1D[np.intp], *tuple[_Array1D[np.intp], ...]]) | |||
assert_type(MAR_2d_f4.nonzero()[0], _Array1D[np.intp]) | |||
|
|||
# Masked Array addition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from here below it's all the maskedarray analogoue to the tests in numpy/typing/tests/data/reveal/arithmetic.pyi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then a classic # Keep in sync with ...
might be helpful here
@@ -368,3 +382,243 @@ assert_type(MAR_2d_f4.T, np.ma.MaskedArray[tuple[int, int], np.dtype[np.float32] | |||
|
|||
assert_type(MAR_2d_f4.nonzero(), tuple[_Array1D[np.intp], *tuple[_Array1D[np.intp], ...]]) | |||
assert_type(MAR_2d_f4.nonzero()[0], _Array1D[np.intp]) | |||
|
|||
# Masked Array addition |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then a classic # Keep in sync with ...
might be helpful here
def __sub__(self, other): ... | ||
def __rsub__(self, other): ... | ||
|
||
# Keep in sync with `ndarray.__add__` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it might also be a good idea to mirror these comments on ndarray
side in __init__.pyi
then
No description provided.