diff options
author | David Cournapeau <cournape@gmail.com> | 2008-04-07 21:34:08 +0000 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2008-04-07 21:34:08 +0000 |
commit | 9842632311a9e38a34c740617f308e7926fd9b71 (patch) | |
tree | 391bf4b0b354c883e9940d391b8650a78c41595d /numpy/testing/utils.py | |
parent | 51f83997e34aedc774a505dc7e3d9980dd1362f2 (diff) | |
download | numpy-9842632311a9e38a34c740617f308e7926fd9b71.tar.gz |
Fix broken detection of nan in comparison function.
Diffstat (limited to 'numpy/testing/utils.py')
-rw-r--r-- | numpy/testing/utils.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py index cd0ec9781..9a3be4b86 100644 --- a/numpy/testing/utils.py +++ b/numpy/testing/utils.py @@ -186,7 +186,7 @@ def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=True): def assert_array_compare(comparison, x, y, err_msg='', verbose=True, header=''): - from numpy.core import asarray, isnan + from numpy.core import asarray, isnan, any x = asarray(x) y = asarray(y) try: @@ -199,7 +199,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True, verbose=verbose, header=header, names=('x', 'y')) assert cond, msg - if isnan(x) or isnan(y): + if any(isnan(x)) or any(isnan(y)): # Handling nan: we first check that x and y have the nan at the # same locations, and then we mask the nan and do the comparison as # usual. |