dedalus.tools.parsing

Tools for equation parsing.

Module Contents

split_equation(equation)

Split equation string into LHS and RHS strings.

Examples

>>> split_equation('f(x, y=5) = x**2')
('f(x, y=5)', 'x**2')
split_call(call)

Convert math-style function definitions into head and arguments.

Examples

>>> split_call('f(x, y)')
('f', ('x', 'y'))
>>> split_call('f')
('f', ())
lambdify_functions(call, result)

Convert math-style function definitions into lambda expressions. Pass other statements without modification.

Examples

>>> lambdify_functions('f(x, y)', 'x*y')
('f', 'lambda x,y: x*y')
>>> lambdify_functions('f', 'a*b')
('f', 'a*b')