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

Method test_subclass

numpy/lib/tests/test_shape_base.py:170–181  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

168 assert_array_equal(result, expected)
169
170 def test_subclass(self):
171 class MinimalSubclass(np.ndarray):
172 data = 1
173
174 def minimal_function(array):
175 return array.data
176
177 a = np.zeros((6, 3)).view(MinimalSubclass)
178
179 assert_array_equal(
180 apply_along_axis(minimal_function, 0, a), np.array([1, 1, 1])
181 )
182
183 def test_scalar_array(self, cls=np.ndarray):
184 a = np.ones((6, 3)).view(cls)

Callers

nothing calls this directly

Calls 3

assert_array_equalFunction · 0.90
apply_along_axisFunction · 0.90
viewMethod · 0.45

Tested by

no test coverage detected