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

Method test_hardmask

numpy/ma/tests/test_mrecords.py:266–281  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

264 raise TypeError("Should have expected a readable buffer object!")
265
266 def test_hardmask(self):
267 # Test hardmask
268 base = self.base.copy()
269 mbase = base.view(mrecarray)
270 mbase.harden_mask()
271 assert_(mbase._hardmask)
272 mbase.mask = nomask
273 assert_equal_records(mbase._mask, base._mask)
274 mbase.soften_mask()
275 assert_(not mbase._hardmask)
276 mbase.mask = nomask
277 # So, the mask of a field is no longer set to nomask...
278 assert_equal_records(mbase._mask,
279 ma.make_mask_none(base.shape, base.dtype))
280 assert_(ma.make_mask(mbase['b']._mask) is nomask)
281 assert_equal(mbase['a']._mask, mbase['b']._mask)
282
283 def test_pickling(self):
284 # Test pickling

Callers

nothing calls this directly

Calls 7

assert_equal_recordsFunction · 0.90
assert_equalFunction · 0.90
assert_Function · 0.50
copyMethod · 0.45
viewMethod · 0.45
harden_maskMethod · 0.45
soften_maskMethod · 0.45

Tested by

no test coverage detected