As part of some work toward code generation from SymPy.jl, I need to map sympy functions to Julia functions. My current approach is a Dict:
symfuncs = Dict(
sympy.log => log
, sympy.Pow => :^
, sympy.Abs => abs
)
Sometimes this works great, but sometimes it evaluates to
julia> Soss.symfuncs
Dict{PyCall.PyObject,Any} with 3 entries:
PyObject NULL => :^
PyObject NULL => abs
PyObject NULL => log
Whether I get the correct result or the NULLs seems nondeterministic.
Is there a clean way to do this so it works consistently?