Commit ed3b4fa3 authored by Dániel Varjas's avatar Dániel Varjas
Browse files

fix behaviour when locals contains numpy array values

parent 488ce42f
......@@ -180,7 +180,11 @@ def sympify(expr, locals=None):
"identifiers and may not be keywords".format(repr(k)))
# sympify values of locals before updating it with extra_ns
locals = {k: sympify(v) for k, v in locals.items()}
# Cast numpy array values in locals to sympy matrices to make sure they have
# correct format
locals = {k: (sympy.Matrix(v) if isinstance(v, np.ndarray) else sympify(v))
for k, v in locals.items()}
for k, v in extra_ns.items():
locals.setdefault(k, v)
Markdown is supported
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