-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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: ma.testutils.assert_equal throws AssertionError on np.nan #20017
base: main
Are you sure you want to change the base?
Conversation
@charris would you mind reviewing this? Thanks! |
Waiting for this to be merged |
|
||
|
||
if __name__ == "__main__": | ||
run_module_suite() |
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.
Does this replace existing tests, if so please remove them from the previous locations.
@@ -108,7 +108,7 @@ def assert_equal_records(a, b): | |||
def assert_equal(actual, desired, err_msg=''): | |||
""" | |||
Asserts that two items are equal. | |||
|
|||
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.
Revert this change
@@ -126,7 +126,8 @@ def assert_equal(actual, desired, err_msg=''): | |||
if not (isinstance(actual, ndarray) or isinstance(desired, ndarray)): | |||
msg = build_err_msg([actual, desired], err_msg,) | |||
if not desired == actual: | |||
raise AssertionError(msg) | |||
# Handle case using testing.assert_equal | |||
return np.testing.assert_equal(actual, desired) |
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 doesn't seem right. Why build the error message and do the check, only to defer to the base-class check? Also: What happens if the order of the arguments is reversed?
Fixes #6661, #20022.
np.ma.testutils.assert_equal
now defaults tonp.testing.assert_equal
if actual or desired are not maskedPreviously
After Fix