-
-
Notifications
You must be signed in to change notification settings - Fork 11k
correct behaviour for assert_array_less with inf/nan #7135
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
@rgommers Can you please review this PR? |
@@ -689,20 +689,13 @@ def chk_same_position(x_id, y_id, hasval='nan'): | |||
|
|||
if isnumber(x) and isnumber(y): | |||
x_isnan, y_isnan = isnan(x), isnan(y) | |||
x_isinf, y_isinf = isinf(x), isinf(y) |
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.
What was the motivation to remove the checks for +/-infinity (these lines and all the ones below)?
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.
Previous logic for assert_array_compare
was if there was inf
in x
or y
, it should be at the same location (array id). It just checks the location of inf
, it does not do any sort of comparison, which is wrong.
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.
So just for my edification, you are relying on all of the following being true?
+inf == +inf
-inf == -inf
-inf < +inf
-inf < some_finite_number
some_finite_number < +inf
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.
Yes
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.
Thanks for the explanation.
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.
any review for this PR? |
This is not correct, look at the compare function passed in
|
☔ The latest upstream changes (presumably #7985) made this pull request unmergeable. Please resolve the merge conflicts. |
Fixes #2418