MCPcopy Index your code
hub / github.com/numpy/numpy / test_linspace

Function test_linspace

numpy/polynomial/tests/test_classes.py:495–510  ·  view source on GitHub ↗
(Poly)

Source from the content-addressed store, hash-verified

493
494
495def test_linspace(Poly):
496 d = Poly.domain + random((2,)) * .25
497 w = Poly.window + random((2,)) * .25
498 p = Poly([1, 2, 3], domain=d, window=w)
499 # check default domain
500 xtgt = np.linspace(d[0], d[1], 20)
501 ytgt = p(xtgt)
502 xres, yres = p.linspace(20)
503 assert_almost_equal(xres, xtgt)
504 assert_almost_equal(yres, ytgt)
505 # check specified domain
506 xtgt = np.linspace(0, 2, 20)
507 ytgt = p(xtgt)
508 xres, yres = p.linspace(20, domain=[0, 2])
509 assert_almost_equal(xres, xtgt)
510 assert_almost_equal(yres, ytgt)
511
512
513def test_pow(Poly):

Callers

nothing calls this directly

Calls 3

assert_almost_equalFunction · 0.90
PolyFunction · 0.85
linspaceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…