Skip to content

Commit

Permalink
XXX add some extension=False workaround's
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Oct 11, 2019
1 parent 6ac9c66 commit 3915784
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion diofant/domains/expressiondomain.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __bool__(self):

def gcd(self, other):
from ..polys import gcd
return self.__class__(gcd(self.ex, self.__class__(other).ex))
return self.__class__(gcd(self.ex, self.__class__(other).ex, extension=False))

def lcm(self, other):
from ..polys import lcm
Expand Down
2 changes: 1 addition & 1 deletion diofant/integrals/meijerint.py
Original file line number Diff line number Diff line change
Expand Up @@ -1422,7 +1422,7 @@ def _rewrite_single(f, x, recursive=True):

if isinstance(f, meijerg):
from ..polys import factor
coeff, m = factor(f.argument, x).as_coeff_mul(x)
coeff, m = factor(f.argument, x, extension=False).as_coeff_mul(x)
if len(m) > 1:
return
m = m[0]
Expand Down
2 changes: 1 addition & 1 deletion diofant/simplify/hyperexpand.py
Original file line number Diff line number Diff line change
Expand Up @@ -2017,7 +2017,7 @@ def carryout_plan(f, ops):
debug(' Recognised polynomial.')
p = apply_operators(res, ops, lambda f: z0*f.diff(z0))
p = apply_operators(p*premult, ops0, lambda f: z0*f.diff(z0))
return unpolarify(simplify(p).subs({z0: z}))
return unpolarify(simplify(unpolarify(p)).subs({z0: z}))

# Try to recognise a shifted sum.
p = Integer(0)
Expand Down
4 changes: 2 additions & 2 deletions diofant/simplify/simplify.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ def shorter(*choices):

expr = bottom_up(expr, lambda w: w.normal())
expr = Mul(*powsimp(expr).as_content_primitive())
_e = cancel(expr)
expr1 = shorter(_e, _mexpand(_e).cancel()) # issue sympy/sympy#6829
_e = cancel(expr, extension=False)
expr1 = shorter(_e, _mexpand(_e).cancel(extension=False)) # issue sympy/sympy#6829
expr2 = shorter(together(expr, deep=True), together(expr1, deep=True))

if ratio is oo:
Expand Down
6 changes: 3 additions & 3 deletions diofant/simplify/trigsimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1131,16 +1131,16 @@ def trigs(x):
TR3, # canonical angles
TR1, # sec-csc -> cos-sin
TR12, # expand tan of sum
lambda x: _eapply(factor, x, trigs),
lambda x: _eapply(lambda e: factor(e, extension=False), x, trigs),
TR2, # tan-cot -> sin-cos
[identity, lambda x: _eapply(_mexpand, x, trigs)],
TR2i, # sin-cos ratio -> tan
lambda x: _eapply(lambda i: factor(i.normal()), x, trigs),
lambda x: _eapply(lambda i: factor(i.normal(), extension=False), x, trigs),
TR14, # factored identities
TR5, # sin-pow -> cos_pow
TR10, # sin-cos of sums -> sin-cos prod
TR11, TR6, # reduce double angles and rewrite cos pows
lambda x: _eapply(factor, x, trigs),
lambda x: _eapply(lambda e: factor(e, extension=False), x, trigs),
TR14, # factored powers of identities
[identity, lambda x: _eapply(_mexpand, x, trigs)],
TRmorrie,
Expand Down
2 changes: 1 addition & 1 deletion diofant/solvers/ode.py
Original file line number Diff line number Diff line change
Expand Up @@ -2715,7 +2715,7 @@ def constantsimp(expr, constants):
expr = __remove_linear_redundancies(expr, Cs)

def _conditional_term_factoring(expr):
new_expr = terms_gcd(expr, clear=False, deep=True, expand=False)
new_expr = terms_gcd(expr, clear=False, deep=True, expand=False, extension=False)

# we do not want to factor exponentials, so handle this separately
if new_expr.is_Mul:
Expand Down
4 changes: 2 additions & 2 deletions diofant/tests/test_wester.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,8 +800,8 @@ def test_M22():


def test_M23():
assert solve(x - 1/sqrt(1 + x**2)) == [{x: -I*sqrt(Rational(1, 2) + sqrt(5)/2)},
{x: sqrt(Rational(-1, 2) + sqrt(5)/2)}]
assert solve(x - 1/sqrt(1 + x**2)) == [{x: sqrt(2)*sqrt(-1 + sqrt(5))/2},
{x: -sqrt(2)*I*sqrt(1 + sqrt(5))/2}]


def test_M24():
Expand Down

0 comments on commit 3915784

Please sign in to comment.