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

Method test_retstep

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

Source from the content-addressed store, hash-verified

410 arange(j+1, dtype=int))
411
412 def test_retstep(self):
413 for num in [0, 1, 2]:
414 for ept in [False, True]:
415 y = linspace(0, 1, num, endpoint=ept, retstep=True)
416 assert isinstance(y, tuple) and len(y) == 2
417 if num == 2:
418 y0_expect = [0.0, 1.0] if ept else [0.0, 0.5]
419 assert_array_equal(y[0], y0_expect)
420 assert_equal(y[1], y0_expect[1])
421 elif num == 1 and not ept:
422 assert_array_equal(y[0], [0.0])
423 assert_equal(y[1], 1.0)
424 else:
425 assert_array_equal(y[0], [0.0][:num])
426 assert isnan(y[1])
427
428 def test_object(self):
429 start = array(1, dtype='O')

Callers

nothing calls this directly

Calls 4

linspaceFunction · 0.90
assert_array_equalFunction · 0.90
assert_equalFunction · 0.90
isnanFunction · 0.90

Tested by

no test coverage detected