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

Class TestArray

numpy/_core/tests/test_multiarray.py:7386–7394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7384
7385 def test_subclass(self):
7386 class TestArray(np.ndarray):
7387 def __new__(cls, data, info):
7388 result = np.array(data)
7389 result = result.view(cls)
7390 result.info = info
7391 return result
7392
7393 def __array_finalize__(self, obj):
7394 self.info = getattr(obj, "info", '')
7395
7396 dat = TestArray([[1, 2, 3, 4], [5, 6, 7, 8]], 'jubba')
7397 res = dat.mean(1)

Callers 1

test_subclassMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_subclassMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…