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

Method test_byview

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

Source from the content-addressed store, hash-verified

36 base = ma.array(list(zip(ilist, flist, slist)), mask=mask, dtype=ddtype)
37
38 def test_byview(self):
39 # Test creation by view
40 base = self.base
41 mbase = base.view(mrecarray)
42 assert_equal(mbase.recordmask, base.recordmask)
43 assert_equal_records(mbase._mask, base._mask)
44 assert_(isinstance(mbase._data, recarray))
45 assert_equal_records(mbase._data, base._data.view(recarray))
46 for field in ('a', 'b', 'c'):
47 assert_equal(base[field], mbase[field])
48 assert_equal_records(mbase.view(mrecarray), mbase)
49
50 def test_get(self):
51 # Tests fields retrieval

Callers

nothing calls this directly

Calls 4

assert_equalFunction · 0.90
assert_equal_recordsFunction · 0.90
assert_Function · 0.85
viewMethod · 0.45

Tested by

no test coverage detected