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

Method test_axis_count

numpy/lib/tests/test_packbits.py:351–366  ·  view source on GitHub ↗
(self, kwargs)

Source from the content-addressed store, hash-verified

349 {'bitorder': 'big', 'count': None},
350 ])
351 def test_axis_count(self, kwargs):
352 packed0 = np.packbits(self.x, axis=0)
353 unpacked0 = np.unpackbits(packed0, axis=0, **kwargs)
354 assert_equal(unpacked0.dtype, np.uint8)
355 if kwargs.get('bitorder', 'big') == 'big':
356 assert_array_equal(unpacked0, self.padded2[:-1, :self.x.shape[1]])
357 else:
358 assert_array_equal(unpacked0[::-1, :], self.padded2[:-1, :self.x.shape[1]])
359
360 packed1 = np.packbits(self.x, axis=1)
361 unpacked1 = np.unpackbits(packed1, axis=1, **kwargs)
362 assert_equal(unpacked1.dtype, np.uint8)
363 if kwargs.get('bitorder', 'big') == 'big':
364 assert_array_equal(unpacked1, self.padded2[:self.x.shape[0], :-1])
365 else:
366 assert_array_equal(unpacked1[:, ::-1], self.padded2[:self.x.shape[0], :-1])
367
368 def test_bad_count(self):
369 packed0 = np.packbits(self.x, axis=0)

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
assert_array_equalFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected