Skip to content

Commit

Permalink
Merge pull request #39 from adrian-lison/develop
Browse files Browse the repository at this point in the history
Bugfix lazy evaluation
  • Loading branch information
adrian-lison authored Sep 23, 2024
2 parents 7db58ab + 9e11dee commit 07d078e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions R/utils_lazy.R
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ tbp <- function(f_name, f_expr,
data = list(), assumptions = list(),
required_data = c(), required_assumptions = c()) {
for(n in names(d_lazy)) {
f_lazy$env <- rlang::env_clone(f_lazy$env)
assign(n, d_lazy[[n]], f_lazy$env)
}
f_lazy$env <- update_env(
Expand Down
2 changes: 1 addition & 1 deletion R/utils_modeldata.R
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ modeldata_validate <- function(modeldata,
cli::cli_abort("Please supply a modeldata object.")
}

for (i in 1:4) { # update three times to catch all lazy evals
for (i in 1:5) { # update several times to catch all lazy evals
modeldata <- modeldata_update(
modeldata,
data = data, assumptions = assumptions, throw_error = F
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ ww_assumptions <- sewer_assumptions(
generation_dist = get_discrete_gamma_shifted(gamma_mean = 3, gamma_sd = 2.4),
shedding_dist = get_discrete_gamma(gamma_shape = 0.929639, gamma_scale = 7.241397),
shedding_reference = "symptom_onset", # shedding load distribution is relative to symptom onset
incubation_dist = get_discrete_gamma(gamma_shape = 8.5, gamma_scale = 0.4),
incubation_dist = get_discrete_gamma(gamma_shape = 8.5, gamma_scale = 0.4)
)
```

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ ww_assumptions <- sewer_assumptions(
generation_dist = get_discrete_gamma_shifted(gamma_mean = 3, gamma_sd = 2.4),
shedding_dist = get_discrete_gamma(gamma_shape = 0.929639, gamma_scale = 7.241397),
shedding_reference = "symptom_onset", # shedding load distribution is relative to symptom onset
incubation_dist = get_discrete_gamma(gamma_shape = 8.5, gamma_scale = 0.4),
incubation_dist = get_discrete_gamma(gamma_shape = 8.5, gamma_scale = 0.4)
)
```

Expand Down

0 comments on commit 07d078e

Please sign in to comment.