[Numpy-svn] r4976 - trunk/numpy/testing

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Apr 7 18:40:52 EDT 2008


Author: cdavid
Date: 2008-04-07 17:40:42 -0500 (Mon, 07 Apr 2008)
New Revision: 4976

Modified:
   trunk/numpy/testing/utils.py
Log:
Revert comparison function; nan handling broken.

Modified: trunk/numpy/testing/utils.py
===================================================================
--- trunk/numpy/testing/utils.py	2008-04-07 21:34:08 UTC (rev 4975)
+++ trunk/numpy/testing/utils.py	2008-04-07 22:40:42 UTC (rev 4976)
@@ -186,7 +186,7 @@
 
 def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
                          header=''):
-    from numpy.core import asarray, isnan, any
+    from numpy.core import asarray
     x = asarray(x)
     y = asarray(y)
     try:
@@ -199,24 +199,7 @@
                                 verbose=verbose, header=header,
                                 names=('x', 'y'))
             assert cond, msg
-        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.
-            xnanid = isnan(x)
-            ynanid = isnan(y)
-            try:
-                assert_array_equal(xnanid, ynanid)
-            except AssertionError:
-                msg = build_err_msg([x, y],
-                                    err_msg
-                                    + '\n(x and y nan location mismatch %s, '
-                                    + '%s mismatch)' % (xnanid, ynanid),
-                                    verbose=verbose, header=header,
-                                    names=('x', 'y'))
-            val = comparison(x[~xnanid], y[~ynanid])
-        else:
-            val = comparison(x,y)
+        val = comparison(x,y)
         if isinstance(val, bool):
             cond = val
             reduced = [0]




More information about the Numpy-svn mailing list