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

Method test_flatten

numpy/lib/tests/test_recfunctions.py:492–504  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

490 assert_equal(test.mask, control.mask)
491
492 def test_flatten(self):
493 # Test standard & flexible
494 (_, x, _, z) = self.data
495 test = merge_arrays((x, z), flatten=True)
496 control = np.array([(1, 'A', 1.), (2, 'B', 2.)],
497 dtype=[('f0', int), ('A', '|S3'), ('B', float)])
498 assert_equal(test, control)
499
500 test = merge_arrays((x, z), flatten=False)
501 control = np.array([(1, ('A', 1.)), (2, ('B', 2.))],
502 dtype=[('f0', int),
503 ('f1', [('A', '|S3'), ('B', float)])])
504 assert_equal(test, control)
505
506 def test_flatten_wflexible(self):
507 # Test flatten standard & nested

Callers

nothing calls this directly

Calls 2

merge_arraysFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected