Generalise distributions input into functions #84
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofpurrr::partial()
, I couldn't see anything that couldn't be replicated by using functions (closures
).The
delay_shape
anddelay_scale
arguments inoutbreak_model()
andscenario_sim()
have been replaced by theonset_to_isolation
argument which accepts afunction
.The incubation period is no longer hard coded in
outbreak_model()
and is added as an argument (incubation_period
) tooutbreak_model()
andscenario_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 useonset_to_isolation
andincubation_period
where necessary. Documentation for new function arguments is added.