Skip to content

Commit 10722d6

Browse files
joshwlambertsbfnk
andauthored
Miscellaneous minor updates from refactor (#136)
Co-authored-by: Sebastian Funk <sebastian.funk@lshtm.ac.uk>
1 parent 68c3f80 commit 10722d6

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# ringbp 0.1.2.9999
22

3+
* The outbreak simulation functions (`scenario_sim()`, `outbreak_model()`, `outbreak_setup()` and `outbreak_step()`) have been refactored to provide a more modular and functional interface. New `delay_opts()`, `event_prob_opts()`, `intervention_opts()`, `offspring_opts()`, and `sim_opts()` helper functions are added. `check_dist_func()` is added and `check_outbreak_input()` removed. The `parameter_sweep()` function is removed and converted into a vignette ({purrr} is removed as a package dependency). `prop_presymptomatic_to_alpha()` is renamed to `presymptomatic_transmission_to_alpha()`. Addresses #65, #91 by @joshwlambert in #127 and reviewed by @pearsonca and @sbfnk.
4+
35
* The `inf_fn()` function has been renamed to `incubation_to_generation_time()` and the `k` function argument (`scenario_sim()`, `outbreak_model()`, `outbreak_step()`) has been renamed `prop_presymptomatic` (in `scenario_sim()` and `outbreak_model()`) or `alpha` (in `outbreak_step()`). The internal `prop_presymptomatic_to_alpha()` function has been added to do the conversion from `prop_presymptomatic` to `alpha`. Addresses #119, #120 by @joshwlambert in #123 and reviewed by @pearsonca and @sbfnk.
46

57
* Added input checking, including new `check_outbreak_input()` function, removed unused argument defaults, consistently ordered arguments in functions, and moved function argument documentation to functions that use the argument. Addresses #89, #91, #93, #116 by @joshwlambert in #117 and reviewed by @pearsonca and @sbfnk.

README.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ res <- scenario_sim(
6060
onset_to_isolation = \(x) stats::rweibull(n = x, shape = 1.651524, scale = 4.287786)
6161
),
6262
event_probs = event_prob_opts(
63-
## no asymptomatic infections
63+
## 10% asymptomatic infections
6464
asymptomatic = 0.1,
65-
## probability of onward infection time being before symptom onset
65+
## 50% probability of onward infection time being before symptom onset
6666
presymptomatic_transmission = 0.5,
6767
## 20% probability of ascertainment by contact tracing
6868
symptomatic_ascertained = 0.2

vignettes/parameter-sweep.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ res <- lapply(scenario_sims$data, \(x, n) {
112112
)
113113
```
114114

115-
The output of this parameter sweep is a list of `data.table`s, so to give an idea of what the output looks like we should the first 3 scenarios (there are `r length(res)` in total). See `?scenario_sim` for more information on the contents of these `data.table`s.
115+
The output of this parameter sweep is a list of `data.table`s, so to give an idea of what the output looks like we show the first 3 scenarios (there are `r length(res)` in total). See `?scenario_sim` for more information on the contents of these `data.table`s.
116116

117117
```{r}
118118
head(res, 3)
@@ -155,7 +155,7 @@ head(scenario_sims$sims, 3)
155155

156156
## Running scenarios in parallel
157157

158-
Finally, we demonstrate how the above example can be easily run in parallel using the [{future} framework](). We load the {future} and {future.apply} R packages for this.
158+
Finally, we demonstrate how the above example can be easily run in parallel using the [{future} framework](https://www.futureverse.org/). We load the {future} and {future.apply} R packages for this.
159159

160160
```{r}
161161
library(future)

0 commit comments

Comments
 (0)