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

Method test_start_stop_array

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

Source from the content-addressed store, hash-verified

246 assert_allclose(t3, t6, rtol=1e-5)
247
248 def test_start_stop_array(self):
249 # Try to use all special cases.
250 start = array([1.e0, 32., 1j, -4j, 1+1j, -1])
251 stop = array([1.e4, 2., 16j, -324j, 10000+10000j, 1])
252 t1 = geomspace(start, stop, 5)
253 t2 = stack([geomspace(_start, _stop, 5)
254 for _start, _stop in zip(start, stop)], axis=1)
255 assert_equal(t1, t2)
256 t3 = geomspace(start, stop[0], 5)
257 t4 = stack([geomspace(_start, stop[0], 5)
258 for _start in start], axis=1)
259 assert_equal(t3, t4)
260 t5 = geomspace(start, stop, 5, axis=-1)
261 assert_equal(t5, t2.T)
262
263 def test_physical_quantities(self):
264 a = PhysicalQuantity(1.0)

Callers

nothing calls this directly

Calls 4

arrayFunction · 0.90
geomspaceFunction · 0.90
stackFunction · 0.90
assert_equalFunction · 0.90

Tested by

no test coverage detected