MCPcopy Index your code
hub / github.com/numpy/numpy / test_shrink_mask

Method test_shrink_mask

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

Source from the content-addressed store, hash-verified

2197 assert_equal(a._mask, zeros(10))
2198
2199 def test_shrink_mask(self):
2200 # Tests .shrink_mask()
2201 a = array([1, 2, 3], mask=[0, 0, 0])
2202 b = a.shrink_mask()
2203 assert_equal(a, b)
2204 assert_equal(a.mask, nomask)
2205
2206 # Mask cannot be shrunk on structured types, so is a no-op
2207 a = np.ma.array([(1, 2.0)], [('a', int), ('b', float)])
2208 b = a.copy()
2209 a.shrink_mask()
2210 assert_equal(a.mask, b.mask)
2211
2212 def test_flat(self):
2213 # 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