summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-03-10 10:05:24 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-03-10 10:05:24 +0000
commit132acae81d471640426edcb37d98361131bf6779 (patch)
tree120498272791143721c8a75408de27ccab5bd04c
parent33c9c5bf1e86d4a768d7b80ed9e53a3278fd0cf5 (diff)
downloadnumpy-132acae81d471640426edcb37d98361131bf6779.tar.gz
Change error raise to warning when __array_() is called with no context
-rw-r--r--numpy/core/ma.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/numpy/core/ma.py b/numpy/core/ma.py
index 36cf32c90..3f047ce3f 100644
--- a/numpy/core/ma.py
+++ b/numpy/core/ma.py
@@ -15,6 +15,7 @@ from numeric import newaxis, ndarray, inf
from oldnumeric import typecodes, amax, amin
from numerictypes import *
import numeric
+import warnings
# Ufunc domain lookup for __array_wrap__
ufunc_domain = {}
@@ -595,10 +596,14 @@ class MaskedArray (object):
if self._mask is not nomask:
if oldnumeric.ravel(self._mask).any():
if context is None:
- raise MAError, \
- """Cannot automatically convert masked array to numeric because data
- is masked in one or more locations.
- """
+ warnings.warn("Cannot automatically convert masked array to "\
+ "numeric because data\n is masked in one or "\
+ "more locations.");
+ return self._data
+ #raise MAError, \
+ # """Cannot automatically convert masked array to numeric because data
+ # is masked in one or more locations.
+ # """
else:
func, args, i = context
fills = ufunc_fills.get(func)