Skip to content
Snippets Groups Projects
Commit 856b8226 authored by Martin Bauer's avatar Martin Bauer
Browse files

sympy 1.1 compatibility

parent bee3bfdf
No related merge requests found
import sympy as sp import sympy as sp
from sympy.utilities.codegen import CCodePrinter try:
from sympy.utilities.codegen import CCodePrinter
except ImportError:
from sympy.printing.ccode import C99CodePrinter as CCodePrinter
from pystencils.astnodes import Node from pystencils.astnodes import Node
from pystencils.types import createType, PointerType from pystencils.types import createType, PointerType
......
...@@ -477,7 +477,7 @@ def typeAllEquations(eqs, typeForSymbol): ...@@ -477,7 +477,7 @@ def typeAllEquations(eqs, typeForSymbol):
typedEquations = [] typedEquations = []
for eq in eqs: for eq in eqs:
if isinstance(eq, sp.Eq): if isinstance(eq, sp.Eq) or isinstance(eq, ast.SympyAssignment):
newLhs = processLhs(eq.lhs) newLhs = processLhs(eq.lhs)
newRhs = processRhs(eq.rhs) newRhs = processRhs(eq.rhs)
typedEquations.append(ast.SympyAssignment(newLhs, newRhs)) typedEquations.append(ast.SympyAssignment(newLhs, newRhs))
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment