Skip to content

Commit

Permalink
Accept command line args for provinces in pipeline
Browse files Browse the repository at this point in the history
The previous download->process pipeline didn't accept provinces as
command line args and had BC/YT hardcoded. This doesn't allow for NT
or any other provinces. This small commit permits any other provinces
to be accepted by the crmprtd_pipeline script.
  • Loading branch information
jameshiebert committed Feb 15, 2024
1 parent 6a2275f commit ded33e2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crmprtd/download_cache_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,9 @@ def dispatch_network(
dry_run=dry_run,
)
elif network_name == "ec":
for province in ("BC", "YT"):
provinces = kwargs.pop("province")

for province in provinces:
download_and_process(
network_name=network_name,
log_args=log_args(**kwargs, province=province),
Expand Down Expand Up @@ -451,6 +453,14 @@ def main(arglist: List[str] = None) -> None:
required=True,
help="Frequency of download (network ec only)",
)
parser.add_argument(
"-p",
"--province",
action="append",
help="2 letter province code",
default=[],
choices=("AB", "BC", "MB", "NB", "NL", "NS", "NT", "NU", "ON", "PE", "QC", "SK", "YT"),
)
args = parser.parse_args(arglist)

# TODO: Add network-dependent time arg here? Currently, it is hardwired in code to
Expand Down

0 comments on commit ded33e2

Please sign in to comment.