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

Method _check_inverse_of_slicing

numpy/lib/tests/test_function_base.py:858–865  ·  view source on GitHub ↗
(self, indices)

Source from the content-addressed store, hash-verified

856 self.nd_a = np.arange(5).repeat(2).reshape(1, 5, 2)
857
858 def _check_inverse_of_slicing(self, indices):
859 a_del = delete(self.a, indices)
860 nd_a_del = delete(self.nd_a, indices, axis=1)
861 msg = 'Delete failed for obj: %r' % indices
862 assert_array_equal(setxor1d(a_del, self.a[indices, ]), self.a,
863 err_msg=msg)
864 xor = setxor1d(nd_a_del[0,:, 0], self.nd_a[0, indices, 0])
865 assert_array_equal(xor, self.nd_a[0,:, 0], err_msg=msg)
866
867 def test_slices(self):
868 lims = [-6, -2, 0, 1, 2, 4, 5]

Callers 3

test_slicesMethod · 0.95
test_fancyMethod · 0.95
test_singleMethod · 0.95

Calls 3

deleteFunction · 0.90
assert_array_equalFunction · 0.90
setxor1dFunction · 0.90

Tested by

no test coverage detected