diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-08-10 18:51:25 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-08-10 18:51:25 +0000 |
commit | a9314ac69c102f5e93a1ff647aa5943e8545433d (patch) | |
tree | 853a681e460a2b97f0f37d43edbefd6aadd3bd2f /numpy/core/ma.py | |
parent | 123a4350fcb303622a6a69d241385d1068cc8cac (diff) | |
download | numpy-a9314ac69c102f5e93a1ff647aa5943e8545433d.tar.gz |
fix more argument lists for ma.py --- output arrays are ignored for masked arrays
Diffstat (limited to 'numpy/core/ma.py')
-rw-r--r-- | numpy/core/ma.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/core/ma.py b/numpy/core/ma.py index 8a74580bb..5c93753a1 100644 --- a/numpy/core/ma.py +++ b/numpy/core/ma.py @@ -620,12 +620,14 @@ class MaskedArray (object): 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.argsort = _m(argsort) 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, |