MCPcopy
hub / github.com/numpy/numpy / test_subclass

Method test_subclass

numpy/_core/tests/test_function_base.py:304–312  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

302 assert_equal(geomspace(a, b), geomspace(1.0, 5.0))
303
304 def test_subclass(self):
305 a = array(1).view(PhysicalQuantity2)
306 b = array(7).view(PhysicalQuantity2)
307 gs = geomspace(a, b)
308 assert type(gs) is PhysicalQuantity2
309 assert_equal(gs, geomspace(1.0, 7.0))
310 gs = geomspace(a, b, 1)
311 assert type(gs) is PhysicalQuantity2
312 assert_equal(gs, geomspace(1.0, 7.0, 1))
313
314 def test_bounds(self):
315 assert_raises(ValueError, geomspace, 0, 10)

Callers

nothing calls this directly

Calls 4

arrayFunction · 0.90
geomspaceFunction · 0.90
assert_equalFunction · 0.90
viewMethod · 0.45

Tested by

no test coverage detected