-
-
Notifications
You must be signed in to change notification settings - Fork 11k
BUG:warn on Nan in minimum,maximum for scalars, float16 #11595
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
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.
Single CI test failure on posix and windows involving np.maximum
and float16
is probably related.
a468867
to
08ddc73
Compare
Removed code that emits a warning on |
The float16 warnings still seem to show up in the tests? |
08ddc73
to
34074ac
Compare
Codecov Report
@@ Coverage Diff @@
## master #11595 +/- ##
==========================================
+ Coverage 85.7% 85.7% +<.01%
==========================================
Files 327 327
Lines 81985 81987 +2
==========================================
+ Hits 70264 70266 +2
Misses 11721 11721
Continue to review full report at Codecov.
|
numpy/core/tests/test_umath.py
Outdated
with suppress_warnings() as sup: | ||
sup.record(RuntimeWarning) | ||
np.minimum(np.nan, 1) | ||
|
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.
assert_warns
should be fine here? But the test does not actually check that the one warning is recorded like this.
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.
fixed
34074ac
to
b63687b
Compare
What was the problem with float16? |
|
@mattip Sounds like float16 should raise a warning just to be consistent, what is the argument against that? |
I thought the argument was: "lets not go there for a minor release"? then again, it might have been, lets put in the quick bug fix before the release happens at the time. I definitely agree that we should enable the warnings for float16, but I would say that now that 15.0 is out, it is simplest to just wait for the next release for the float16 part (I assume the float32 is partially a regression here), it is not a huge deal and has been buggy forever. |
See PR #11660 which extends this for 1.16 (no backport of that PR needed) |
Thanks Matti. |
Fixes #11589
PR #11043 added a check for Nan in the minimum, maximum loops.
Scalars and
float16
take a different code path through maximum, minimum that was not checked. Tests added that failed before and pass after the fix.