Skip to content
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

Generalise distributions input into functions #84

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

joshwlambert
Copy link
Collaborator

This PR closes #59 & #63 by generalising the random number generating functions input into {ringbp} functions.

The dist_setup() function has been removed. From looking into the functionality of purrr::partial(), I couldn't see anything that couldn't be replicated by using functions (closures).

The delay_shape and delay_scale arguments in outbreak_model() and scenario_sim() have been replaced by the onset_to_isolation argument which accepts a function.

The incubation period is no longer hard coded in outbreak_model() and is added as an argument (incubation_period) to outbreak_model() and scenario_sim().

The use of anonymous functions as function inputs follows design decisions made in {simulist}, so if this is not the best approach for parameterising distributions for the simulation model, I'd been happy to discuss it as it may benefit more than one package.

Unit tests for dist_setup() have been removed, other tests are updated to use onset_to_isolation and incubation_period where necessary. Documentation for new function arguments is added.

@joshwlambert joshwlambert added the enhancement New feature or request label Mar 10, 2025
@joshwlambert joshwlambert requested a review from sbfnk March 10, 2025 14:50
@pearsonca
Copy link
Collaborator

i definitely want to chime in on this one, but am going to need a day or few - what's the timeline your end @joshwlambert?

@joshwlambert
Copy link
Collaborator Author

@pearsonca no strict deadline from my side. If we can get this merged by the end of this week it would be good. Cheers for wanting to review, I'll tag you as a reviewer.

@joshwlambert joshwlambert requested a review from pearsonca March 10, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hard coded parameters/distributions
2 participants