-
Notifications
You must be signed in to change notification settings - Fork 2
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
Combine simulate_tree()
and simulate_tree_from_pop()
into simulate_chains()
.
#171
Conversation
@sbfnk I've struggled to include the logic for dealing with the case where the total new cases > susceptible population given arbitrary Lines 215 to 218 in 5c007e1
It is more straightforward in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff! Just a few questions/suggestions for improvement.
Seems like some unrelated changes to the citation/roxygen/wodlist made it into this?
I added some references to the documentation of |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #171 +/- ##
==========================================
+ Coverage 99.11% 99.26% +0.15%
==========================================
Files 8 8
Lines 562 684 +122
==========================================
+ Hits 557 679 +122
Misses 5 5 ☔ View full report in Codecov by Sentry. |
Co-authored-by: Sebastian Funk <sebastian.funk@lshtm.ac.uk>
…> susc Co-authored-by: Sebastian Funk <sebastian.funk@lshtm.ac.uk>
Co-authored-by: Sebastian Funk <sebastian.funk@lshtm.ac.uk>
c85e6d0
to
d098e55
Compare
simulate_chains()
.
simulate_chains()
.simulate_tree()
and simulate_tree_from_pop()
into simulate_chains()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I've suggested a small change to the examples to make it clearer that not all arguments are required (would require re-rendering the docs, too, if going ahead with it).
It's a good revision. Thanks, Seb. |
Co-authored-by: Sebastian Funk <sebastian.funk@lshtm.ac.uk>
Turns out my suggested commit was in the |
This PR seeks to close #142 and fix #8 using ideas from #114, by combining
simulate_tree()
andsimulate_tree_from_pop()
into a single function. It does this by extendingsimulate_tree()
to accept optionalpop
andpercent_immune
arguments that are used to track a susceptible population as an additional stopping criterion in the branching process simulations.Branching processes are now simulated with an initial set of cases and an offspring distribution until no offspring can be produced because
stat_max
is reached or the susceptible population is completely exhausted.A feature.
There are two separate functions for simulating solely from an initial number of cases (
simulate_tree()
) or from a susceptible populationsimulate_tree_from_pop()
The new
simulate_chains()
acceptsindex_cases
as a required argument and optionalpop
andpercent_immune
arguments for creating a susceptible population to be tracked. Whenpop = Inf
andpercent_immune = 0
,simulate_chains() is the same as
simulate_tree()`.Not necessarily.
I have increased the cyclocomp_linter limit to 25 to accommodate the changes here. I will link an issue to deal with reducing the complexity in
simulate_chains()
.