diff options
author | jamestwebber <jamestwebber@gmail.com> | 2013-04-20 12:40:22 -0700 |
---|---|---|
committer | jamestwebber <jamestwebber@gmail.com> | 2013-04-20 12:40:22 -0700 |
commit | abaf953637e92a622c1b0d797ec77f05a7c6e600 (patch) | |
tree | eefc10d3ad982d383aef38779df8e2c2141556d1 /numpy/ma | |
parent | 4e6b48e65ed839ab57eb66e38f9b08f3f43163be (diff) | |
download | numpy-abaf953637e92a622c1b0d797ec77f05a7c6e600.tar.gz |
Adding a test for #3265
Test to ensure that MaskedArray.filled() doesn't change the order of the array.
This test is a little messy because there are problems constructing an F-contiguous masked array in the first place. I had to explicitly pass in F-contiguous arrays for data and mask.
Diffstat (limited to 'numpy/ma')
-rw-r--r-- | numpy/ma/tests/test_core.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py index 0846bb6e5..9d0c84735 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -538,6 +538,15 @@ class TestMaskedArray(TestCase): assert_equal(test, control) + def test_filled_w_f_order(self): + "Test filled w/ F-contiguous array" + a = array(np.array([(0, 1, 2), (4, 5, 6)], order='F'), + mask=np.array([(0, 0, 1), (1, 0, 0)], order='F'), + order='F') # this is currently ignored + self.assertTrue(a.flags['F_CONTIGUOUS']) + self.assertTrue(a.filled(0).flags['F_CONTIGUOUS']) + + def test_optinfo_propagation(self): "Checks that _optinfo dictionary isn't back-propagated" x = array([1, 2, 3, ], dtype=float) |