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

Method test_subclasses

numpy/lib/tests/test_function_base.py:2974–2980  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2972 [3., 3., 1.]]))
2973
2974 def test_subclasses(self):
2975 class subclass(np.ndarray):
2976 pass
2977 x = np.arange(5.).view(subclass)
2978 r = piecewise(x, [x < 2., x >= 4], [-1., 1., 0.])
2979 assert_equal(type(r), subclass)
2980 assert_equal(r, [-1., -1., 0., 0., 1.])
2981
2982
2983class TestBincount:

Callers

nothing calls this directly

Calls 3

piecewiseFunction · 0.90
assert_equalFunction · 0.90
viewMethod · 0.45

Tested by

no test coverage detected