Hi,
I was trying to debug a problem I was having with lambdify, and I got
stuck trying to understand the newish 'dummify' changes.
So, it's nice that this works now:
from sympy import symbols, lambdify, sin
from sympy.utilities.lambdify import implemented_function
t = symbols('t')
x = sin
y = x(t)
f = lambdify(y, 2*y, modules=None)
# Evaluates OK
print(f(0))
But I'm not sure why this should not also work:
f = lambdify(y, 2*y, modules='sympy')
# Error evaluating lambda
print(f(0))
In order for this to work, I believe the 'dummify' parameter to
'lambdastr' has to be set to True from the call in 'lambdify', but
this only happens if the strings 'numpy', 'math' or 'mpmath' appear
first in the module list. For example these also fail:
f = lambdify(y, 2*y, modules=numpy)
f = lambdify(y, 2*y, modules=dict(sin=math.sin))
x = implemented_function('x', lambda x : x + 1)
y = x(t)
f = lambdify(y, 2*y, modules='sympy')
Is it easy to explain why these should not work?
Thanks a lot,
Matthew
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.