MCPcopy Create free account
hub / github.com/numpy/numpy / test_shrink_mask

Method test_shrink_mask

numpy/ma/tests/test_core.py:2032–2043  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2030 assert_equal(a._mask, zeros(10))
2031
2032 def test_shrink_mask(self):
2033 # Tests .shrink_mask()
2034 a = array([1, 2, 3], mask=[0, 0, 0])
2035 b = a.shrink_mask()
2036 assert_equal(a, b)
2037 assert_equal(a.mask, nomask)
2038
2039 # Mask cannot be shrunk on structured types, so is a no-op
2040 a = np.ma.array([(1, 2.0)], [('a', int), ('b', float)])
2041 b = a.copy()
2042 a.shrink_mask()
2043 assert_equal(a.mask, b.mask)
2044
2045 def test_flat(self):
2046 # Test that flat can return all types of items [#4585, #4615]

Callers

nothing calls this directly

Calls 4

arrayFunction · 0.90
assert_equalFunction · 0.90
shrink_maskMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected