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

Method test_fromflex

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

Source from the content-addressed store, hash-verified

3802 assert_equal_records(record['_mask'], data._mask)
3803
3804 def test_fromflex(self):
3805 # Test the reconstruction of a masked_array from a record
3806 a = array([1, 2, 3])
3807 test = fromflex(a.toflex())
3808 assert_equal(test, a)
3809 assert_equal(test.mask, a.mask)
3810
3811 a = array([1, 2, 3], mask=[0, 0, 1])
3812 test = fromflex(a.toflex())
3813 assert_equal(test, a)
3814 assert_equal(test.mask, a.mask)
3815
3816 a = array([(1, 1.), (2, 2.), (3, 3.)], mask=[(1, 0), (0, 0), (0, 1)],
3817 dtype=[('A', int), ('B', float)])
3818 test = fromflex(a.toflex())
3819 assert_equal(test, a)
3820 assert_equal(test.data, a.data)
3821
3822 def test_arraymethod(self):
3823 # Test a _arraymethod w/ n argument

Callers

nothing calls this directly

Calls 4

arrayFunction · 0.90
fromflexFunction · 0.90
assert_equalFunction · 0.90
toflexMethod · 0.80

Tested by

no test coverage detected