-
-
Notifications
You must be signed in to change notification settings - Fork 11.9k
TYP: Type MaskedArray.take and np.ma.take
#28680
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
Conversation
jorenham
left a comment
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.
This looks good. I left some suggestions that could make this even better.
|
there are some merge conflicts |
numpy/ma/core.pyi
Outdated
| @overload | ||
| def take( | ||
| self, | ||
| indices: _IntLike_co, | ||
| axis: SupportsIndex | None = None, | ||
| out: None = None, | ||
| mode: _ModeKind = 'raise', | ||
| ) -> Any: ... |
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.
The overload above always gets matched, so unless I'm missing something, this one can be removed.
| @overload | |
| def take( | |
| self, | |
| indices: _IntLike_co, | |
| axis: SupportsIndex | None = None, | |
| out: None = None, | |
| mode: _ModeKind = 'raise', | |
| ) -> Any: ... |
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.
ah, thanks! I was under the impression that some masked arrays could be of dtypes that might not be possible to match against MaskedArray[_SCT], but I should have asked
have removed 👍
numpy/ma/core.pyi
Outdated
| @overload | ||
| def take( | ||
| self, | ||
| indices: _ArrayLikeInt_co, | ||
| axis: SupportsIndex | None = None, | ||
| out: None = None, | ||
| mode: _ModeKind = 'raise', | ||
| ) -> _MaskedArray[Any]: ... |
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.
Same story here
| @overload | |
| def take( | |
| self, | |
| indices: _ArrayLikeInt_co, | |
| axis: SupportsIndex | None = None, | |
| out: None = None, | |
| mode: _ModeKind = 'raise', | |
| ) -> _MaskedArray[Any]: ... |
|
Thanks, Marco |
* TYP: Type ``MaskedArray.take`` and ``np.ma.take`` * broaden `a` type * it gets broader * 🎨 * remove redundant overloads * reduce diff
No description provided.