From 019542c13ee696784336f1a904a2040728b2ec78 Mon Sep 17 00:00:00 2001 From: contradict Date: Sun, 12 Nov 2023 09:28:09 -0800 Subject: [PATCH] Fix sympy test 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. --- test/sympy.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/sympy.jl b/test/sympy.jl index 9bbc10438..ef8a75172 100644 --- a/test/sympy.jl +++ b/test/sympy.jl @@ -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])