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

Method test_flatten

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

Source from the content-addressed store, hash-verified

498 assert_equal(test.mask, control.mask)
499
500 def test_flatten(self):
501 # Test standard & flexible
502 _, x, _, z = self._create_arrays()
503 test = merge_arrays((x, z), flatten=True)
504 control = np.array([(1, 'A', 1.), (2, 'B', 2.)],
505 dtype=[('f0', int), ('A', '|S3'), ('B', float)])
506 assert_equal(test, control)
507
508 test = merge_arrays((x, z), flatten=False)
509 control = np.array([(1, ('A', 1.)), (2, ('B', 2.))],
510 dtype=[('f0', int),
511 ('f1', [('A', '|S3'), ('B', float)])])
512 assert_equal(test, control)
513
514 def test_flatten_wflexible(self):
515 # Test flatten standard & nested

Callers

nothing calls this directly

Calls 3

_create_arraysMethod · 0.95
merge_arraysFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected