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

Method test_chebfromroots

numpy/polynomial/tests/test_chebyshev.py:546–553  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

544class TestMisc:
545
546 def test_chebfromroots(self):
547 res = cheb.chebfromroots([])
548 assert_almost_equal(trim(res), [1])
549 for i in range(1, 5):
550 roots = np.cos(np.linspace(-np.pi, 0, 2*i + 1)[1::2])
551 tgt = [0]*i + [1]
552 res = cheb.chebfromroots(roots)*2**(i-1)
553 assert_almost_equal(trim(res), trim(tgt))
554
555 def test_chebroots(self):
556 assert_almost_equal(cheb.chebroots([1]), [])

Callers

nothing calls this directly

Calls 3

assert_almost_equalFunction · 0.90
linspaceMethod · 0.80
trimFunction · 0.70

Tested by

no test coverage detected