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 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.

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.