Skip to content

Commit

Permalink
default delay is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
jcblemai committed Jan 8, 2024
1 parent 4c47608 commit 792ec9b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
26 changes: 16 additions & 10 deletions flepimop/gempyor_pkg/src/gempyor/outcomes.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,23 @@ def read_parameters_from_config(modinf: model_info.ModelInfo):
else:
parameters[new_comp]["probability::npi_param_name"] = f"{new_comp}::probability".lower()

parameters[new_comp]["delay"] = outcomes_config[new_comp]["delay"]["value"]
if outcomes_config[new_comp]["delay"]["modifier_parameter"].exists():
parameters[new_comp]["delay::npi_param_name"] = (
outcomes_config[new_comp]["delay"]["modifier_parameter"].as_str().lower()
)
logging.debug(
f"delay of outcome {new_comp} is affected by intervention "
f"named {parameters[new_comp]['delay::npi_param_name']} "
f"instead of {new_comp}::delay"
)
if outcomes_config[new_comp]["delay"].exists():
parameters[new_comp]["delay"] = outcomes_config[new_comp]["delay"]["value"]
if outcomes_config[new_comp]["delay"]["modifier_parameter"].exists():
parameters[new_comp]["delay::npi_param_name"] = (
outcomes_config[new_comp]["delay"]["modifier_parameter"].as_str().lower()
)
logging.debug(
f"delay of outcome {new_comp} is affected by intervention "
f"named {parameters[new_comp]['delay::npi_param_name']} "
f"instead of {new_comp}::delay"
)
else:
parameters[new_comp]["delay::npi_param_name"] = f"{new_comp}::delay".lower()
else:
logging.critical(f"No delay for outcome {new_comp}, using a 0 delay")
outcomes_config[new_comp]["delay"] = {"value": 0}
parameters[new_comp]["delay"] = outcomes_config[new_comp]["delay"]["value"]
parameters[new_comp]["delay::npi_param_name"] = f"{new_comp}::delay".lower()

if outcomes_config[new_comp]["duration"].exists():
Expand Down
10 changes: 1 addition & 9 deletions flepimop/gempyor_pkg/tests/outcomes/config_mc_selection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,14 @@ outcomes:
modifier_parameter: incidICU_probability
value:
distribution: fixed
value: .8
delay:
value:
distribution: fixed
value: 0
value: .8 # test with no delay
incidICU_1dose:
source: incidH_1dose
probability:
modifier_parameter: incidICU_probability
value:
distribution: fixed
value: .8
delay:
value:
distribution: fixed
value: 0
incidD_0dose:
source: incidI_0dose
probability:
Expand Down

0 comments on commit 792ec9b

Please sign in to comment.