Repository navigation
DEP: Deprecate collapsing shape-1 dtype fields to scalars. #13326
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -221,7 +221,8 @@ def __getattribute__(self, attr): | |
| except IndexError: | ||
| # Couldn't find a mask: use the default (nomask) | ||
| pass | ||
| hasmasked = _mask.view((bool, (len(_mask.dtype) or 1))).any() | ||
| tp_len = len(_mask.dtype) | ||
| hasmasked = _mask.view((bool, ((tp_len,) if tp_len else ()))).any() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This if condition should be If you're looking for another deprecation for another PR, len(dtype) is looking like a bad idea on non structured dtypes... If not, I'll probably do that myself.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although actually the function is crap anyway and should be using one of the recursive helpers in ma/core that ors together all the fields
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So should I update this PR, or just leave it as it is and let you do a followup? (I would prefer the latter :))
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose you could argue that this PR is about fixing things for length-1 subarrays, and you've succeeded even without fixing this. I think fine to put in as is, assuming we can sort out the ci failure by restarting |
||
| if (obj.shape or hasmasked): | ||
| obj = obj.view(MaskedArray) | ||
| obj._baseclass = ndarray | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.