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

Function test_cast

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

Source from the content-addressed store, hash-verified

77
78
79def test_cast(Poly1, Poly2):
80 x = np.linspace(0, 1, 10)
81 coef = random((3,))
82
83 d1 = Poly1.domain + random((2,)) * .25
84 w1 = Poly1.window + random((2,)) * .25
85 p1 = Poly1(coef, domain=d1, window=w1)
86
87 d2 = Poly2.domain + random((2,)) * .25
88 w2 = Poly2.window + random((2,)) * .25
89 p2 = Poly2.cast(p1, domain=d2, window=w2)
90
91 assert_almost_equal(p2.domain, d2)
92 assert_almost_equal(p2.window, w2)
93 assert_almost_equal(p2(x), p1(x))
94
95
96#

Callers

nothing calls this directly

Calls 3

assert_almost_equalFunction · 0.90
linspaceMethod · 0.80
castMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…