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

Function test_roots

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

Source from the content-addressed store, hash-verified

420
421
422def test_roots(Poly):
423 d = Poly.domain * 1.25 + .25
424 w = Poly.window
425 tgt = np.linspace(d[0], d[1], 5)
426 res = np.sort(Poly.fromroots(tgt, domain=d, window=w).roots())
427 assert_almost_equal(res, tgt)
428 # default domain and window
429 res = np.sort(Poly.fromroots(tgt).roots())
430 assert_almost_equal(res, tgt)
431
432
433def test_degree(Poly):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…