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
BUG: Make mask_invalid
consistent with mask_where
if copy
is set to False
#22046
Changes from 2 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 |
---|---|---|
|
@@ -4496,6 +4496,14 @@ def test_where_structured_masked(self): | |
assert_equal(ma, expected) | ||
assert_equal(ma.mask, expected.mask) | ||
|
||
def test_masked_invalid_error(self): | ||
a = np.arange(5, dtype=object) | ||
a[3] = np.PINF | ||
a[2] = np.NaN | ||
with pytest.raises(TypeError, | ||
match="not supported for the input types"): | ||
np.ma.masked_invalid(a) | ||
|
||
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. We were looking at this in the triage meeting as well. I guess the test is great (I honestly still need to parse it fully). 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 have added a new test in 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. Yeah, thanks. It is true that A test too much cannot hurt :). I find it odd that we consider Thanks @cmarmo, lets get this in! |
||
def test_choose(self): | ||
# Test choose | ||
choices = [[0, 1, 2, 3], [10, 11, 12, 13], | ||
|
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.
Was there a particular reason for this try/except, or is it a debug remnant?
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.
Indeed, I can't recall why I put the try/except. Suggestion applied. Thanks!