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

Method test_unique_subclass

numpy/lib/tests/test_arraysetops.py:834–849  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

832 self.check_all(a, b, i1, i2, c, dt)
833
834 def test_unique_subclass(self):
835 class Subclass(np.ndarray):
836 pass
837
838 i1 = [2, 3, 0, 1]
839 i2 = [2, 3, 0, 1, 0, 2, 3] * 10
840 c = np.multiply([2, 1, 2, 2], 10)
841
842 # test for numeric arrays
843 types = self.get_types()
844 for dt in types:
845 a = np.array([5, 7, 1, 2, 1, 5, 7] * 10, dtype=dt)
846 b = np.array([1, 2, 5, 7], dtype=dt)
847 aa = Subclass(a.shape, dtype=dt, buffer=a)
848 bb = Subclass(b.shape, dtype=dt, buffer=b)
849 self.check_all(aa, bb, i1, i2, c, dt)
850
851 def test_unique_byte_string_hash_based(self):
852 # test for byte string arrays

Callers

nothing calls this directly

Calls 3

get_typesMethod · 0.95
check_allMethod · 0.95
SubclassClass · 0.70

Tested by

no test coverage detected