MCPcopy Index your code
hub / github.com/numpy/numpy / test_rename_fields

Method test_rename_fields

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

Source from the content-addressed store, hash-verified

103 assert_equal(test, control)
104
105 def test_rename_fields(self):
106 # Test rename fields
107 a = np.array([(1, (2, [3.0, 30.])), (4, (5, [6.0, 60.]))],
108 dtype=[('a', int),
109 ('b', [('ba', float), ('bb', (float, 2))])])
110 test = rename_fields(a, {'a': 'A', 'bb': 'BB'})
111 newdtype = [('A', int), ('b', [('ba', float), ('BB', (float, 2))])]
112 control = a.view(newdtype)
113 assert_equal(test.dtype, newdtype)
114 assert_equal(test, control)
115
116 def test_get_names(self):
117 # Test get_names

Callers

nothing calls this directly

Calls 3

rename_fieldsFunction · 0.90
assert_equalFunction · 0.90
viewMethod · 0.45

Tested by

no test coverage detected