[Scipy-svn] r3228 - in trunk/Lib/sandbox/maskedarray: . tests

scipy-svn at scipy.org scipy-svn at scipy.org
Mon Aug 13 09:14:52 EDT 2007


Author: pierregm
Date: 2007-08-13 08:14:46 -0500 (Mon, 13 Aug 2007)
New Revision: 3228

Modified:
   trunk/Lib/sandbox/maskedarray/core.py
   trunk/Lib/sandbox/maskedarray/tests/test_core.py
Log:
core : fixed a pb w/ maximum/minimum on multiD arrays (thx to Eric Firing)

Modified: trunk/Lib/sandbox/maskedarray/core.py
===================================================================
--- trunk/Lib/sandbox/maskedarray/core.py	2007-08-11 00:56:45 UTC (rev 3227)
+++ trunk/Lib/sandbox/maskedarray/core.py	2007-08-13 13:14:46 UTC (rev 3228)
@@ -2017,7 +2017,8 @@
         else:
             kargs = {}
             target = target.ravel()
-
+            if not (m is nomask):
+                m = m.ravel()
         if m is nomask:
             t = self.ufunc.reduce(target, **kargs)
         else:

Modified: trunk/Lib/sandbox/maskedarray/tests/test_core.py
===================================================================
--- trunk/Lib/sandbox/maskedarray/tests/test_core.py	2007-08-11 00:56:45 UTC (rev 3227)
+++ trunk/Lib/sandbox/maskedarray/tests/test_core.py	2007-08-13 13:14:46 UTC (rev 3228)
@@ -301,6 +301,10 @@
         assert_equal(maximum(x,y), where(greater(x,y), x, y))
         assert minimum(x) == 0
         assert maximum(x) == 4
+        #
+        x = arange(4).reshape(2,2)
+        x[-1,-1] = masked
+        assert_equal(maximum(x), 2)
         
     def check_minmax_methods(self):        
         "Additional tests on max/min"




More information about the Scipy-svn mailing list