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

Method test_tobits

numpy/_core/tests/test_simd.py:190–197  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188 assert data_xnor == vxnor
189
190 def test_tobits(self):
191 data2bits = lambda data: sum(int(x != 0) << i for i, x in enumerate(data, 0))
192 for data in (self._data(), self._data(reverse=True)):
193 vdata = self._load_b(data)
194 data_bits = data2bits(data)
195 tobits = self.tobits(vdata)
196 bin_tobits = bin(tobits)
197 assert bin_tobits == bin(data_bits)
198
199 def test_pack(self):
200 """

Callers

nothing calls this directly

Calls 3

_dataMethod · 0.95
_load_bMethod · 0.95
sumFunction · 0.85

Tested by

no test coverage detected