(self)
| 134 | class TestFraction: |
| 135 | |
| 136 | def test_Fraction(self): |
| 137 | # assert we can use Polynomials with coefficients of object dtype |
| 138 | f = Fraction(2, 3) |
| 139 | one = Fraction(1, 1) |
| 140 | zero = Fraction(0, 1) |
| 141 | p = poly.Polynomial([f, f], domain=[zero, one], window=[zero, one]) |
| 142 | |
| 143 | x = 2 * p + p ** 2 |
| 144 | assert_equal(x.coef, np.array([Fraction(16, 9), Fraction(20, 9), |
| 145 | Fraction(4, 9)], dtype=object)) |
| 146 | assert_equal(p.domain, [zero, one]) |
| 147 | assert_equal(p.coef.dtype, np.dtypes.ObjectDType()) |
| 148 | assert_(isinstance(p(f), Fraction)) |
| 149 | assert_equal(p(f), Fraction(10, 9)) |
| 150 | p_deriv = poly.Polynomial([Fraction(2, 3)], domain=[zero, one], |
| 151 | window=[zero, one]) |
| 152 | assert_equal(p.deriv(), p_deriv) |
| 153 | |
| 154 | class TestEvaluation: |
| 155 | # coefficients of 1 + 2*x + 3*x**2 |
nothing calls this directly
no test coverage detected