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

Function test_roots

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

Source from the content-addressed store, hash-verified

402
403
404def test_roots(Poly):
405 d = Poly.domain * 1.25 + .25
406 w = Poly.window
407 tgt = np.linspace(d[0], d[1], 5)
408 res = np.sort(Poly.fromroots(tgt, domain=d, window=w).roots())
409 assert_almost_equal(res, tgt)
410 # default domain and window
411 res = np.sort(Poly.fromroots(tgt).roots())
412 assert_almost_equal(res, tgt)
413
414
415def test_degree(Poly):

Callers

nothing calls this directly

Calls 5

assert_almost_equalFunction · 0.90
linspaceMethod · 0.80
sortMethod · 0.80
fromrootsMethod · 0.80
rootsMethod · 0.45

Tested by

no test coverage detected