Skip to content

Commit

Permalink
Fix sympy test
Browse files Browse the repository at this point in the history
This test was failin localy with

    Expression: SymPy.simplify(symbolics_to_sympy(Symbolics.solve_for(expr, p))) == (SymPy.solve(sexpr, sp))[1]
     Evaluated: -2*t*(x^2 + y(t) - 1)/(x^2 + x + y(t) - 1) == 2*t*(-x^2 - y(t) + 1)/(x^2 + x + y(t) - 1)

While equal, they are not the same expression. `SymPy.simplify` and
`SymPy.solve` don't seem to guarantee identical expressions, so pass
both results through `simplify` to ensure they are comparable.
  • Loading branch information
contradict committed Nov 12, 2023
1 parent 43f93d0 commit 019542c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/sympy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ expr = x * p + (x^2 - 1 + y) * (p + 2t)
sexpr = symbolics_to_sympy(expr)
sp = symbolics_to_sympy(p)

@test SymPy.simplify(symbolics_to_sympy(Symbolics.solve_for(expr, p))) == SymPy.solve(sexpr, sp)[1]
@test SymPy.simplify(symbolics_to_sympy(Symbolics.solve_for(expr, p))) == SymPy.simplify(SymPy.solve(sexpr, sp)[1])

0 comments on commit 019542c

Please sign in to comment.