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

Method test_subclass

numpy/core/tests/test_function_base.py:268–276  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

266 assert_equal(geomspace(a, b), geomspace(1.0, 5.0))
267
268 def test_subclass(self):
269 a = array(1).view(PhysicalQuantity2)
270 b = array(7).view(PhysicalQuantity2)
271 gs = geomspace(a, b)
272 assert type(gs) is PhysicalQuantity2
273 assert_equal(gs, geomspace(1.0, 7.0))
274 gs = geomspace(a, b, 1)
275 assert type(gs) is PhysicalQuantity2
276 assert_equal(gs, geomspace(1.0, 7.0, 1))
277
278 def test_bounds(self):
279 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