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

Method test_subclasses

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

Source from the content-addressed store, hash-verified

2709 [3., 3., 1.]]))
2710
2711 def test_subclasses(self):
2712 class subclass(np.ndarray):
2713 pass
2714 x = np.arange(5.).view(subclass)
2715 r = piecewise(x, [x<2., x>=4], [-1., 1., 0.])
2716 assert_equal(type(r), subclass)
2717 assert_equal(r, [-1., -1., 0., 0., 1.])
2718
2719
2720class TestBincount:

Callers

nothing calls this directly

Calls 3

piecewiseFunction · 0.90
assert_equalFunction · 0.90
viewMethod · 0.45

Tested by

no test coverage detected