flo-schu / pymob

Python model building platform
MIT License
0 stars 0 forks source link

Simplify parameterize/dispatch method #71

Open flo-schu opened 4 months ago

flo-schu commented 4 months ago

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

self.dispatch(parameters_free, parameters_fixed=None, y0=None, x_in=None) 

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

flo-schu commented 4 months ago

This also links to #68 and to #37

flo-schu commented 2 weeks ago

This is almost done and can be closed when #22 is resolved