-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Models as components for CallableNumericalModel
#251
Comments
My only issue with this is that it makes it a little bit harder for users to create a |
Why is it harder for functions that only return a number? We can already do that now, right? Like, {y: lambda x: x} is valid input to |
Maybe I'm missing something. I was under the impression you'd have to provide |
Ah, I see what you mean. No, I'm not intending to always use the |
Taking the example from #248, we realized that the syntax for
CallableNumericalModel
's could be improved a bit fromto
if we make
CallableNumericalModel
's aware ofAns
objects to automate the unpacking. (ODEModel
is used here for no particular reason, could be any model.) I think this looks a lot cleaner. However, this could potentially open a pandora's box I haven't thought about, but for now I think it's save.An interesting extension would be tuple unpacking for multicomponent models:
where
y2
is set toNone
so it is ignored in the optimization as usual. The general invariant here would be{ode_model.dependent_vars: ode_model}
.For general models this might not be a good idea because of the extra work involved for calculating jacobians etc, but for
CallableNumericalModel
this might in fact be a powerful addition.The text was updated successfully, but these errors were encountered: