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

Method test_flatten_wflexible

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

Source from the content-addressed store, hash-verified

504 assert_equal(test, control)
505
506 def test_flatten_wflexible(self):
507 # Test flatten standard & nested
508 (w, x, _, _) = self.data
509 test = merge_arrays((x, w), flatten=True)
510 control = np.array([(1, 1, 2, 3.0), (2, 4, 5, 6.0)],
511 dtype=[('f0', int),
512 ('a', int), ('ba', float), ('bb', int)])
513 assert_equal(test, control)
514
515 test = merge_arrays((x, w), flatten=False)
516 controldtype = [('f0', int),
517 ('f1', [('a', int),
518 ('b', [('ba', float), ('bb', int), ('bc', [])])])]
519 control = np.array([(1., (1, (2, 3.0, ()))), (2, (4, (5, 6.0, ())))],
520 dtype=controldtype)
521 assert_equal(test, control)
522
523 def test_wmasked_arrays(self):
524 # Test merge_arrays masked arrays

Callers

nothing calls this directly

Calls 2

merge_arraysFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected