summaryrefslogtreecommitdiff
path: root/numpy/ma/tests
diff options
context:
space:
mode:
authorpierregm <pierregm@localhost>2009-02-07 09:19:12 +0000
committerpierregm <pierregm@localhost>2009-02-07 09:19:12 +0000
commitc180e36cf4438947de5ba38c90ec30e9538f2f10 (patch)
treec7ee8855ee4594b8d5f2b7d9a474755373c38424 /numpy/ma/tests
parentb9086fdf39941343fde65551b8667e635e05f14f (diff)
downloadnumpy-c180e36cf4438947de5ba38c90ec30e9538f2f10.tar.gz
MaskedArray.resize : systematically raise a TypeError exception, as a masked array never owns its data
MaskedIterator : fixed to allow .flat on masked matrices
Diffstat (limited to 'numpy/ma/tests')
-rw-r--r--numpy/ma/tests/test_core.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index 9c523429a..f13ff3377 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -1122,6 +1122,17 @@ class TestMaskedArrayAttributes(TestCase):
a[1] = 1
assert_equal(a._mask, zeros(10))
+ def test_flat(self):
+ "Test flat on masked_matrices"
+ test = ma.array(np.matrix([[1, 2, 3]]), mask=[0, 0, 1])
+ test.flat = ma.array([3, 2, 1], mask=[1, 0, 0])
+ control = ma.array(np.matrix([[3, 2, 1]]), mask=[1, 0, 0])
+ assert_equal(test, control)
+ #
+ test = ma.array(np.matrix([[1, 2, 3]]), mask=[0, 0, 1])
+ testflat = test.flat
+ testflat[:] = testflat[[2, 1, 0]]
+ assert_equal(test, control)
#------------------------------------------------------------------------------