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

Function test_conversion

numpy/polynomial/tests/test_classes.py:62–76  ·  view source on GitHub ↗
(Poly1, Poly2)

Source from the content-addressed store, hash-verified

60
61
62def test_conversion(Poly1, Poly2):
63 x = np.linspace(0, 1, 10)
64 coef = random((3,))
65
66 d1 = Poly1.domain + random((2,)) * .25
67 w1 = Poly1.window + random((2,)) * .25
68 p1 = Poly1(coef, domain=d1, window=w1)
69
70 d2 = Poly2.domain + random((2,)) * .25
71 w2 = Poly2.window + random((2,)) * .25
72 p2 = p1.convert(kind=Poly2, domain=d2, window=w2)
73
74 assert_almost_equal(p2.domain, d2)
75 assert_almost_equal(p2.window, w2)
76 assert_almost_equal(p2(x), p1(x))
77
78
79def test_cast(Poly1, Poly2):

Callers

nothing calls this directly

Calls 3

assert_almost_equalFunction · 0.90
linspaceMethod · 0.80
convertMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…