Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TYP: TypeMaskedArray.__{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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
MarcoGorelli wants to merge5 commits intonumpy:main
base:main
Choose a base branch
Loading
fromMarcoGorelli:ma-arithmetic

Conversation

MarcoGorelli
Copy link
Member

No description provided.

@@ -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
Copy link
MemberAuthor

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 innumpy/typing/tests/data/reveal/arithmetic.pyi

jorenham reacted with thumbs up emoji
Copy link
Member

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

@jorenhamjorenham self-requested a reviewMay 20, 2025 14:08
@@ -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
Copy link
Member

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__`
Copy link
Member

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 onndarray side in__init__.pyi then

@MarcoGorelliMarcoGorelli marked this pull request as ready for reviewMay 20, 2025 21:31
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@jorenhamjorenhamjorenham left review comments

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@MarcoGorelli@jorenham

[8]ページ先頭

©2009-2025 Movatter.jp