[Numpy-svn] r2987 - trunk/numpy/core

numpy-svn at scipy.org numpy-svn at scipy.org
Thu Aug 10 13:51:27 CDT 2006


Author: oliphant
Date: 2006-08-10 13:51:25 -0500 (Thu, 10 Aug 2006)
New Revision: 2987

Modified:
   trunk/numpy/core/ma.py
Log:
fix more argument lists for ma.py --- output arrays are ignored for masked arrays

Modified: trunk/numpy/core/ma.py
===================================================================
--- trunk/numpy/core/ma.py	2006-08-10 13:37:43 UTC (rev 2986)
+++ trunk/numpy/core/ma.py	2006-08-10 18:51:25 UTC (rev 2987)
@@ -620,12 +620,14 @@
         else:
             return self._data
 
-    def __array_wrap__ (self, array, context):
+    def __array_wrap__ (self, array, context=None):
         """Special hook for ufuncs.
 
         Wraps the numpy array and sets the mask according to
         context.
         """
+        if context is None:
+            return MaskedArray(array, copy=False, mask=nomask)
         func, args = context[:2]
         domain = ufunc_domain[func]
         m = reduce(mask_or, [getmask(a) for a in args])
@@ -2146,12 +2148,12 @@
 array.base = property(_m(not_implemented))
 array.byteswap = _m(not_implemented)
 
-def _choose(self, *args):
+def _choose(self, *args, **kwds):
     return choose(self, args)
 array.choose = _m(_choose)
 del _choose
 
-def _clip(self,a_min,a_max):
+def _clip(self,a_min,a_max,out=None):
     return MaskedArray(data = self.data.clip(asarray(a_min).data, 
                                              asarray(a_max).data),
                        mask = mask_or(self.mask,



More information about the Numpy-svn mailing list