(Poly1, Poly2)
| 71 | |
| 72 | |
| 73 | def test_cast(Poly1, Poly2): |
| 74 | x = np.linspace(0, 1, 10) |
| 75 | coef = random((3,)) |
| 76 | |
| 77 | d1 = Poly1.domain + random((2,))*.25 |
| 78 | w1 = Poly1.window + random((2,))*.25 |
| 79 | p1 = Poly1(coef, domain=d1, window=w1) |
| 80 | |
| 81 | d2 = Poly2.domain + random((2,))*.25 |
| 82 | w2 = Poly2.window + random((2,))*.25 |
| 83 | p2 = Poly2.cast(p1, domain=d2, window=w2) |
| 84 | |
| 85 | assert_almost_equal(p2.domain, d2) |
| 86 | assert_almost_equal(p2.window, w2) |
| 87 | assert_almost_equal(p2(x), p1(x)) |
| 88 | |
| 89 | |
| 90 | # |
nothing calls this directly
no test coverage detected