sympy_to_str function
(Shortest import: from brian2.parsing.sympytools import sympy_to_str)
- brian2.parsing.sympytools.sympy_to_str(sympy_expr)[source]
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 likeAbs
(for example, if an expression such assqrt(x**2)
appeared somewhere). We do want to re-translateAbs
intoabs
in this case.- Parameters:
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.