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

Function test_linspace

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

Source from the content-addressed store, hash-verified

475
476
477def test_linspace(Poly):
478 d = Poly.domain + random((2,))*.25
479 w = Poly.window + random((2,))*.25
480 p = Poly([1, 2, 3], domain=d, window=w)
481 # check default domain
482 xtgt = np.linspace(d[0], d[1], 20)
483 ytgt = p(xtgt)
484 xres, yres = p.linspace(20)
485 assert_almost_equal(xres, xtgt)
486 assert_almost_equal(yres, ytgt)
487 # check specified domain
488 xtgt = np.linspace(0, 2, 20)
489 ytgt = p(xtgt)
490 xres, yres = p.linspace(20, domain=[0, 2])
491 assert_almost_equal(xres, xtgt)
492 assert_almost_equal(yres, ytgt)
493
494
495def test_pow(Poly):

Callers

nothing calls this directly

Calls 4

assert_almost_equalFunction · 0.90
PolyFunction · 0.85
pFunction · 0.85
linspaceMethod · 0.80

Tested by

no test coverage detected