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

Some small fixes to errors in aggregation stuff #241

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ seir:

seir_modifiers:
scenarios:
- Ro_all
- inference
modifiers:
Ro_mod: # assume same for all subpopulations
method: SinglePeriodModifier
Expand Down Expand Up @@ -86,7 +86,7 @@ seir_modifiers:
sd: 0.025
a: -0.1
b: 0.1
Ro_all:
inference:
method: StackedModifier
modifiers: ["Ro_mod","Ro_lockdown"]

Expand Down Expand Up @@ -122,10 +122,10 @@ outcomes:

outcome_modifiers:
scenarios:
- test_limits
- all
modifiers:
# assume that due to limitations in testing, initially the case detection probability was lower
test_limits:
all:
method: SinglePeriodModifier
parameter: incidCase
subpop: "all"
Expand Down
7 changes: 4 additions & 3 deletions flepimop/main_scripts/inference_slot.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ if (opt$config == ""){
}
config = flepicommon::load_config(opt$config)

opt$total_ll_multiplier <- 1
if (!is.null(config$inference$incl_aggr_likelihood)){
print("Using config option for `incl_aggr_likelihood`.")
opt$incl_aggr_likelihood <- config$inference$incl_aggr_likelihood
Expand Down Expand Up @@ -450,7 +451,7 @@ for(seir_modifiers_scenario in seir_modifiers_scenarios) {
autowrite_seir = TRUE
)
}, error = function(e) {
print("GempyorInference failed to run (call on l. 405 of inference_slot.R).")
print("GempyorInference failed to run (call on l. 443 of inference_slot.R).")
print("Here is all the debug information I could find:")
for(m in reticulate::py_last_error()) print(m)
stop("GempyorInference failed to run... stopping")
Expand Down Expand Up @@ -637,8 +638,8 @@ for(seir_modifiers_scenario in seir_modifiers_scenarios) {
sim_hosp <- sim_hosp %>%
dplyr::bind_rows(
sim_hosp %>%
dplyr::select(-tidyselect::all_of(obs_subpop), -tidyselect::starts_with("date")) %>%
dplyr::group_by(time) %>%
dplyr::select(-tidyselect::all_of(obs_subpop)) %>%
dplyr::group_by(date) %>%
dplyr::summarise(dplyr::across(tidyselect::everything(), sum)) %>% # no likelihood is calculated for time periods with missing data for any subpop
dplyr::mutate(!!obs_subpop := "Total")
)
Expand Down
Loading