summaryrefslogtreecommitdiff
path: root/numpy/ma/testutils.py
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2008-12-22 10:01:51 +0000
committerpierregm <pierregm@localhost>2008-12-22 10:01:51 +0000
commit934b27413ae9bd02fe40bafcf040a6f3fe0edff8 (patch)
treef8c40822f330dbc727ba3d6459fb1a880770fa2c /numpy/ma/testutils.py
parent13ad7269de41edb67b786bbeb7605c1702003e84 (diff)
downloadnumpy-934b27413ae9bd02fe40bafcf040a6f3fe0edff8.tar.gz
testutils:
assert_array_compare : make sure that the comparison is performed on ndarrays, and make sure we use the np version of the comparison function. core: * Try not to touch the data in unary/binary ufuncs, (including inplace)
Diffstat (limited to 'numpy/ma/testutils.py')
-rw-r--r--numpy/ma/testutils.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/numpy/ma/testutils.py b/numpy/ma/testutils.py
index 28754bccc..df7484f0a 100644
--- a/numpy/ma/testutils.py
+++ b/numpy/ma/testutils.py
@@ -167,22 +167,24 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True, header='',
"""Asserts that a comparison relation between two masked arrays is satisfied
elementwise."""
# Fill the data first
- xf = filled(x)
- yf = filled(y)
+# xf = filled(x)
+# yf = filled(y)
# Allocate a common mask and refill
m = mask_or(getmask(x), getmask(y))
- x = masked_array(xf, copy=False, mask=m)
- y = masked_array(yf, copy=False, mask=m)
+ x = masked_array(x, copy=False, mask=m, subok=False)
+ y = masked_array(y, copy=False, mask=m, subok=False)
if ((x is masked) and not (y is masked)) or \
((y is masked) and not (x is masked)):
msg = build_err_msg([x, y], err_msg=err_msg, verbose=verbose,
header=header, names=('x', 'y'))
raise ValueError(msg)
# OK, now run the basic tests on filled versions
+ comparison = getattr(np, comparison.__name__, lambda x,y: True)
return utils.assert_array_compare(comparison,
- x.filled(fill_value), y.filled(fill_value),
- err_msg=err_msg,
- verbose=verbose, header=header)
+ x.filled(fill_value),
+ y.filled(fill_value),
+ err_msg=err_msg,
+ verbose=verbose, header=header)
def assert_array_equal(x, y, err_msg='', verbose=True):