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

Method test_wrap

numpy/core/tests/test_multiarray.py:5169–5174  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5167 assert_array_equal(x.take([2], axis=0, mode='clip')[0], x[1])
5168
5169 def test_wrap(self):
5170 x = np.random.random(24)*100
5171 x.shape = 2, 3, 4
5172 assert_array_equal(x.take([-1], axis=0, mode='wrap')[0], x[1])
5173 assert_array_equal(x.take([2], axis=0, mode='wrap')[0], x[0])
5174 assert_array_equal(x.take([3], axis=0, mode='wrap')[0], x[1])
5175
5176 @pytest.mark.parametrize('dtype', ('>i4', '<i4'))
5177 def test_byteorder(self, dtype):

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
randomMethod · 0.80
takeMethod · 0.80

Tested by

no test coverage detected