You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
doing Model({y: 0.}) or CallableModel({y: 0.}) (whatever the constant value in the expression) returns: AttributeError: 'float' object has no attribute 'free_symbols'
That is a problem when, for instance, we want to create a model after n-derivations and variables are no longer present in the expression.
Could please fix that or tell me if a work around exists.
Thanks,
Patrick
The text was updated successfully, but these errors were encountered:
Interesting use-case! This is definitely something I'd like to fix, but I'm not sure on what kind of time-line. With a bit of luck I'll manage a PR within a week or so.
In the meantime you can try something along the following lines: Model({y: sympy.Expr(0)}). No idea if that works though.
Yes that would work. The PR for this should be really simple actually, because sympy already has a method sympify that does exactly this. So we should first check if the value is an Expr, and if it isn't we call sympify on it. We can probably not call sympify on all our input without checking, because I'm not sure what that would do to e.g. Parameters.
Hello,
doing
Model({y: 0.})
orCallableModel({y: 0.})
(whatever the constant value in the expression) returns:AttributeError: 'float' object has no attribute 'free_symbols'
That is a problem when, for instance, we want to create a model after n-derivations and variables are no longer present in the expression.
Could please fix that or tell me if a work around exists.
Thanks,
Patrick
The text was updated successfully, but these errors were encountered: