Skip to content

Commit cf1185b

Browse files
committed
changes to allow use of the new field
These changes should only be merged into main at the same time as the config generator library gets these changse merged
1 parent f9486d7 commit cf1185b

3 files changed

Lines changed: 38 additions & 2 deletions

File tree

azure/generate_configs.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ def main(
4545
help="Production date in ISO format. Default is today", show_default=False
4646
),
4747
] = date.today().isoformat(),
48+
facility_active_proportion: Annotated[
49+
float,
50+
typer.Option(
51+
help="""
52+
Minimum proportion of days of a facility must be actively reporting DDI
53+
counts during the modeling period. Must be a number between 0 and 1.
54+
Default is 1.0, meaning all facilities must have been active every day.
55+
""",
56+
show_default=True,
57+
),
58+
] = 1.0,
4859
):
4960
"""
5061
Generate and upload config files for the epinow2 pipeline.
@@ -58,6 +69,12 @@ def main(
5869
if not job_id:
5970
raise ValueError("Job ID cannot be empty")
6071

72+
# Make sure facility_active_proportion is between 0 and 1.
73+
if not (0 <= facility_active_proportion <= 1):
74+
raise ValueError(
75+
"facility_active_proportion must be between 0 and 1, inclusive."
76+
)
77+
6178
# Generate and upload to blob for all states and diseases.
6279
generate_config(
6380
state=state,
@@ -73,6 +90,7 @@ def main(
7390
job_id=job_id,
7491
as_of_date=as_of_date_str,
7592
output_container=output_container,
93+
facility_active_proportion=facility_active_proportion,
7694
)
7795

7896

azure/generate_rerun_configs.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ def main(
5050
show_default=False,
5151
),
5252
] = None,
53+
facility_active_proportion: Annotated[
54+
float,
55+
typer.Option(
56+
help="""
57+
Minimum proportion of days of a facility must be actively reporting DDI
58+
counts during the modeling period. Must be a number between 0 and 1.
59+
Default is 1.0, meaning all facilities must have been active every day.
60+
""",
61+
show_default=True,
62+
),
63+
] = 1.0,
5364
):
5465
"""
5566
Generate and upload config files for rerunning the epinow2 pipeline.
@@ -62,6 +73,12 @@ def main(
6273
if not job_id:
6374
raise ValueError("Job ID cannot be empty")
6475

76+
# Make sure facility_active_proportion is between 0 and 1.
77+
if not (0 <= facility_active_proportion <= 1):
78+
raise ValueError(
79+
"facility_active_proportion must be between 0 and 1, inclusive."
80+
)
81+
6582
# Generate and upload to blob for all states and diseases.
6683
generate_rerun_config(
6784
state="all",
@@ -78,6 +95,7 @@ def main(
7895
as_of_date=now.isoformat(),
7996
output_container=output_container,
8097
data_exclusions_path=data_exclusions_path,
98+
facility_active_proportion=facility_active_proportion,
8199
)
82100

83101

azure/run_container_app_job.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def main(image_name: str, config_container: str, job_id: str):
9898
state_config = config_path.split("/").pop()
9999
job_execution_id = job_execution.id.split("/").pop()
100100
print(
101-
f"Started Container App Job #{i+1}/{len(task_configs)} for {state_config} with execution ID: {job_execution_id}"
101+
f"Started Container App Job #{i + 1}/{len(task_configs)} for {state_config} with execution ID: {job_execution_id}"
102102
)
103103

104104

@@ -118,7 +118,7 @@ def main(image_name: str, config_container: str, job_id: str):
118118
"--config_container",
119119
type=str,
120120
help="The name of the storage container where config files are located",
121-
default="rt-epinow2-config"
121+
default="rt-epinow2-config",
122122
)
123123
parser.add_argument(
124124
"--job_id",

0 commit comments

Comments
 (0)