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

Method test_flatten_wflexible

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

Source from the content-addressed store, hash-verified

512 assert_equal(test, control)
513
514 def test_flatten_wflexible(self):
515 # Test flatten standard & nested
516 w, x, _, _ = self._create_arrays()
517 test = merge_arrays((x, w), flatten=True)
518 control = np.array([(1, 1, 2, 3.0), (2, 4, 5, 6.0)],
519 dtype=[('f0', int),
520 ('a', int), ('ba', float), ('bb', int)])
521 assert_equal(test, control)
522
523 test = merge_arrays((x, w), flatten=False)
524 f1_descr = [('a', int), ('b', [('ba', float), ('bb', int), ('bc', [])])]
525 controldtype = [('f0', int), ('f1', f1_descr)]
526 control = np.array([(1., (1, (2, 3.0, ()))), (2, (4, (5, 6.0, ())))],
527 dtype=controldtype)
528 assert_equal(test, control)
529
530 def test_wmasked_arrays(self):
531 # Test merge_arrays masked arrays

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