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

Method test_repack_fields

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

Source from the content-addressed store, hash-verified

217 assert_equal(test[0], a[test[-1]])
218
219 def test_repack_fields(self):
220 dt = np.dtype('u1,f4,i8', align=True)
221 a = np.zeros(2, dtype=dt)
222
223 assert_equal(repack_fields(dt), np.dtype('u1,f4,i8'))
224 assert_equal(repack_fields(a).itemsize, 13)
225 assert_equal(repack_fields(repack_fields(dt), align=True), dt)
226
227 # make sure type is preserved
228 dt = np.dtype((np.record, dt))
229 assert_(repack_fields(dt).type is np.record)
230
231 def test_structured_to_unstructured(self, tmp_path):
232 a = np.zeros(4, dtype=[('a', 'i4'), ('b', 'f4,u2'), ('c', 'f4', 2)])

Callers

nothing calls this directly

Calls 4

assert_equalFunction · 0.90
repack_fieldsFunction · 0.90
assert_Function · 0.90
dtypeMethod · 0.45

Tested by

no test coverage detected