Reusing existing functions in our package can be hard from time to time. Especially if you want to pass another distribution to a lower level function.
For example, if you want to change the delay-width distribution in the
delay_cases function it is difficult or even impossible if you do not want to jump into the source code of our package!
Currently, the kwargs of delay_cases look as follows
Here I propose to change the kwargs to incorporate for more general usage! Giving users the possibility to pass pymc distributions to the functions (like Gamma, or anything else ). This applies to nearly all functions in the model submodule.
Taking the example from before this will look as follows:
This allows a user to pass a custom median delay distribution or specify other kwargs for the default distribution. This also makes the code more readable in my opinion.
Todo
Update model submodule
[x] week_modulation.py
[x] delay.py
[x] compartmental_models.py
[x] likelihood.py
[x] spreading_rate.py
[x] utility.py
Update examples:
[x] One bundesland
[x] Bunddesländer
[x] Paper scenarios
[x] What if
Other:
[ ] check documentation
Considerations
This will most likely break all legacy code! But as the legacy code most likely uses pymc3 i.e. covid19_inference~0.3 this should not be a big problem.
Reusing existing functions in our package can be hard from time to time. Especially if you want to pass another distribution to a lower level function.
For example, if you want to change the
delay-width
distribution in thedelay_cases
function it is difficult or even impossible if you do not want to jump into the source code of our package!Currently, the kwargs of
delay_cases
look as followsHere I propose to change the kwargs to incorporate for more general usage! Giving users the possibility to pass pymc distributions to the functions (like Gamma, or anything else ). This applies to nearly all functions in the
model
submodule.Taking the example from before this will look as follows:
This allows a user to pass a custom median delay distribution or specify other kwargs for the default distribution. This also makes the code more readable in my opinion.
Todo
Update model submodule
Update examples:
Other:
Considerations
This will most likely break all legacy code! But as the legacy code most likely uses pymc3 i.e. covid19_inference~0.3 this should not be a big problem.