Closed JohnGoertz closed 4 years ago
This originates from aspiring an interface similar to scipy.integrate.ode
.
On the other hand, I see no problem with additionally allowing for a single iterable as an argument, so this is now implemented.
Thanks for requesting this.
(JITCODE v. 1.4.0)
When specifying control parameters for an ODE through jitcode(...,control_pars=[...]), a list is passed containing all the symbols to act as control parameters. However, set_parameters doesn't accept a list as input.
Using the Lotka-Volterra oscillator as an example:
This works, because the list input to set_parameters is unpacked with *. However, if
ODE.set_parameters([0.6])
is used instead, it fails with the ambiguous ValueError "Wrong input" (and ODE.check() gives no information). Given that list comprehensions are probably the easiest way to both specify the control params/values and to ensure their order remains consistent, it'd be good if their implementation was consistent between control_params and set_parameters. At least, the documentation should be updated to specify that a list input to set_parameters needs to be unpacked.