Skip to content

Commit

Permalink
whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
eendebakpt committed Aug 28, 2023
1 parent e29841a commit 91583a2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions numpy/polynomial/tests/test_polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,20 @@ def test_polypow(self):
class TestFraction:

def test_Fraction(self):
# assert we can caculate with Polynomials with coefficients of object dtype
f = Fraction(2,3)
one = Fraction(1,1)
zero = Fraction(0,1)
# assert we can use Polynomials with coefficients of object dtype
f = Fraction(2, 3)
one = Fraction(1, 1)
zero = Fraction(0, 1)
p = poly.Polynomial([f, f], domain=[zero, one], window=[zero, one])

x= 2*p + p**2
assert_equal(x.coef, np.array([Fraction(16, 9), Fraction(20, 9), Fraction(4, 9)], dtype=object))
x= 2 * p + p**2
assert_equal(x.coef, np.array([Fraction(16, 9), Fraction(20, 9),
Fraction(4, 9)], dtype=object))
assert_equal(p.domain, [zero, one])
assert_equal(p.coef.dtype, np.dtypes.ObjectDType())
self.assertIsInstance(p(f), Fraction)
assert_equal(p(f), Fraction(10, 9))
p_deriv = poly.Polynomial([Fraction(2,3)], domain=[zero, one], window=[zero, one])
p_deriv = poly.Polynomial([Fraction(2, 3)], domain=[zero, one], window=[zero, one])
assert_equal(p.deriv(), p_deriv)

class TestEvaluation:
Expand Down

0 comments on commit 91583a2

Please sign in to comment.