[Numpy-svn] r5705 - trunk/numpy/ma

numpy-svn@scip... numpy-svn@scip...
Tue Aug 26 14:30:51 CDT 2008


Author: charris
Date: 2008-08-26 14:30:50 -0500 (Tue, 26 Aug 2008)
New Revision: 5705

Modified:
   trunk/numpy/ma/core.py
Log:
BUG: fix part of ticket #893

Modified: trunk/numpy/ma/core.py
===================================================================
--- trunk/numpy/ma/core.py	2008-08-26 18:41:53 UTC (rev 5704)
+++ trunk/numpy/ma/core.py	2008-08-26 19:30:50 UTC (rev 5705)
@@ -328,6 +328,7 @@
     if not subok:
         return data.view(ndarray)
     return data
+
 getdata = get_data
 
 def fix_invalid(a, mask=nomask, copy=True, fill_value=None):
@@ -522,7 +523,7 @@
         self.__name__ = getattr(mbfunc, "__name__", str(mbfunc))
         ufunc_domain[mbfunc] = None
         ufunc_fills[mbfunc] = (fillx, filly)
-    #
+
     def __call__ (self, a, b, *args, **kwargs):
         "Execute the call behavior."
         m = mask_or(getmask(a), getmask(b))
@@ -539,7 +540,7 @@
         elif m:
             return masked
         return result
-    #
+
     def reduce(self, target, axis=0, dtype=None):
         """Reduce `target` along the given `axis`."""
         if isinstance(target, MaskedArray):
@@ -3846,9 +3847,11 @@
     if len(fb.shape) == 0:
         fb.shape = (1,)
     return np.inner(fa, fb).view(MaskedArray)
-inner.__doc__ = np.inner.__doc__
-inner.__doc__ += doc_note("Masked values are replaced by 0.")
+
 innerproduct = inner
+if np.inner.__doc__ is not None :
+    notes = doc_note("Masked values are replaced by 0.")
+    inner.__doc__ = np.inner.__doc__ + notes
 
 def outer(a, b):
     "maskedarray version of the numpy function."
@@ -3863,9 +3866,11 @@
     mb = getmaskarray(b)
     m = make_mask(1-np.outer(1-ma, 1-mb), copy=0)
     return masked_array(d, mask=m)
-outer.__doc__ = np.outer.__doc__
-outer.__doc__ += doc_note("Masked values are replaced by 0.")
+
 outerproduct = outer
+if np.outer.__doc__ is not None :
+    notes = doc_note("Masked values are replaced by 0.")
+    outer.__doc__ = np.outer.__doc__ + notes
 
 def allequal (a, b, fill_value=True):
     """Return True if all entries of a and b are equal, using



More information about the Numpy-svn mailing list