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

Method test_fromarrays

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

Source from the content-addressed store, hash-verified

400 data = (mrec, nrec, ddtype)
401
402 def test_fromarrays(self):
403 _a = ma.array([1, 2, 3], mask=[0, 0, 1], dtype=int)
404 _b = ma.array([1.1, 2.2, 3.3], mask=[0, 0, 1], dtype=float)
405 _c = ma.array(['one', 'two', 'three'], mask=[0, 0, 1], dtype='|S8')
406 (mrec, nrec, _) = self.data
407 for (f, l) in zip(('a', 'b', 'c'), (_a, _b, _c)):
408 assert_equal(getattr(mrec, f)._mask, l._mask)
409 # One record only
410 _x = ma.array([1, 1.1, 'one'], mask=[1, 0, 0], dtype=object)
411 assert_equal_records(fromarrays(_x, dtype=mrec.dtype), mrec[0])
412
413 def test_fromrecords(self):
414 # Test construction from records.

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
assert_equal_recordsFunction · 0.90
fromarraysFunction · 0.90

Tested by

no test coverage detected