diff options
author | Simon Conseil <contact@saimon.org> | 2015-12-01 22:08:31 +0100 |
---|---|---|
committer | Simon Conseil <contact@saimon.org> | 2015-12-01 22:08:31 +0100 |
commit | 511dab48438dcc9470b5632e206eeef74f5ad6bc (patch) | |
tree | 5d0bc855ee2fe7d59ebf9aa6f4f5e9c5a2e8638c /numpy | |
parent | 70d8cf55339eca151ad0896526f2e0815dba1489 (diff) | |
download | numpy-511dab48438dcc9470b5632e206eeef74f5ad6bc.tar.gz |
Add some tests for mask creation with mask=True or False.
Diffstat (limited to 'numpy')
-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 e5fdfddb1..cab5abb33 100644 --- a/numpy/ma/tests/test_core.py +++ b/numpy/ma/tests/test_core.py @@ -191,6 +191,15 @@ class TestMaskedArray(TestCase): dma_3 = MaskedArray(dma_1, mask=[1, 0, 0, 0] * 6) fail_if_equal(dma_3.mask, dma_1.mask) + x = array([1, 2, 3], mask=True) + assert_equal(x._mask, [True, True, True]) + x = array([1, 2, 3], mask=False) + assert_equal(x._mask, [False, False, False]) + y = array([1, 2, 3], mask=x._mask, copy=False) + assert_(np.may_share_memory(x.mask, y.mask)) + y = array([1, 2, 3], mask=x._mask, copy=True) + assert_(not np.may_share_memory(x.mask, y.mask)) + def test_creation_with_list_of_maskedarrays(self): # Tests creaating a masked array from alist of masked arrays. x = array(np.arange(5), mask=[1, 0, 0, 0, 0]) |