Currently, parameterize is always converted to a staticmethod, where only theta can be passed. This feature is clunky but brings the benefit that a separate parameterize method can be specified, which does extra transformation of the parameters before they are forwarded to the simulation, which can be very useful. It is however not very inuitive in its use
I would love to have the dispatch method be able to take all potential input arguments
when the optional arguments are None, they should default to the keys in the model_parameters attribute. If not the would update the model_parameters and then in the parameterize method, the model_parameters are passed as well. I do not see a large difference to the parameterize method with functools. For backends, potentially kwargs could be defined that handle the input
TODOS
[ ] improve dispatch method and remove partial redefinitions of the parameterize method
[ ] Test if it still works to re-define parameterize methods
[ ] Add a validity checker for parameterize
[ ] Add type hints for dispatch and parameterize methods
[ ] remove # type: ignore in SimulationBase calls to parameterize
[ ] Update backends to the new API, but retain backwards compatibility
Currently, parameterize is always converted to a staticmethod, where only theta can be passed. This feature is clunky but brings the benefit that a separate parameterize method can be specified, which does extra transformation of the parameters before they are forwarded to the simulation, which can be very useful. It is however not very inuitive in its use
I would love to have the
dispatch
method be able to take all potential input argumentswhen the optional arguments are None, they should default to the keys in the
model_parameters
attribute. If not the would update themodel_parameters
and then in the parameterize method, themodel_parameters
are passed as well. I do not see a large difference to theparameterize
method with functools. For backends, potentiallykwargs
could be defined that handle the inputTODOS
dispatch
method and removepartial
redefinitions of theparameterize
method# type: ignore
inSimulationBase
calls to parameterize