sympy_to_str function

(Shortest import: from brian2.parsing.sympytools import sympy_to_str)


Converts a sympy expression into a string. This could be as easy as str(sympy_exp) but it is possible that the sympy expression contains functions like Abs (for example, if an expression such as sqrt(x**2) appeared somewhere). We do want to re-translate Abs into abs in this case.


sympy_expr : sympy.core.expr.Expr

The expression that should be converted to a string.

Returns :

str_expr : str

A string representing the sympy expression.