Skip to content

Commit

Permalink
Merge branch 'add-wastewater-data' of https://github.com/CDCgov/pyren…
Browse files Browse the repository at this point in the history
…ew-hew into add-wastewater-data
  • Loading branch information
sbidari committed Feb 5, 2025
2 parents 49c34e7 + f7ead9c commit 098a1fb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 49 deletions.
31 changes: 5 additions & 26 deletions .github/workflows/containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ concurrency:
cancel-in-progress: true

env:
REGISTRY: cfaprdbatchcr.azurecr.io/
IMAGE_NAME: pyrenew-hew

jobs:
Expand All @@ -21,36 +20,16 @@ jobs:
name: Build and push image

steps:

- name: Checkout code
uses: actions/checkout@v4

# From: https://stackoverflow.com/a/58035262/2097171
- name: Extract branch name
run: |
echo "name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> \
$GITHUB_OUTPUT
id: branch

- name: Figure out tag (either latest if it is main or the branch name)
id: image
run: |
if [ "${{ steps.branch.outputs.name }}" = "main" ]; then
echo "tag=latest" >> $GITHUB_OUTPUT
else
echo "tag=${{ steps.branch.outputs.name }}" >> $GITHUB_OUTPUT
fi
- name: Building and push the image
id: build-image
- name: Build and push image
id: build-push
uses: CDCgov/cfa-actions/[email protected]
with:
container-file-1: ./Containerfile.dependencies
container-file-2: ./Containerfile
first-step-cache-key: docker-dependencies-${{ runner.os }}-${{ hashFiles('./Containerfile.dependencies') }}
registry: ${{ env.REGISTRY }}
username: cfaprdbatchcr
password: ${{ secrets.CFAPRDBATCHCR_REGISTRY_PASSWORD }}
registry: ${{ vars.CONTAINER_REGISTRY }}
username: ${{ vars.CONTAINER_REGISTRY_USERNAME }}
password: ${{ secrets.CONTAINER_REGISTRY_PASSWORD }}
image: ${{ env.IMAGE_NAME }}
build-args-2: |
TAG=${{ steps.image.outputs.tag }}
Expand Down
11 changes: 3 additions & 8 deletions pipelines/batch/setup_eval_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from azuretools.client import get_batch_service_client
from azuretools.job import create_job_if_not_exists
from azuretools.task import get_container_settings, get_task_config
from forecasttools import location_table


def main(
Expand Down Expand Up @@ -147,15 +148,9 @@ def main(
"'"
)

locations = pl.read_csv(
"https://www2.census.gov/geo/docs/reference/state.txt", separator="|"
)
loc_abbrs = location_table.get_column("short_name").to_list()

all_locations = (
locations.filter(~pl.col("STUSAB").is_in(excluded_locations))
.get_column("STUSAB")
.to_list()
) + ["US"]
all_locations = [loc for loc in loc_abbrs if loc not in excluded_locations]

report_dates = [
datetime.date(2023, 10, 11) + datetime.timedelta(weeks=x)
Expand Down
12 changes: 3 additions & 9 deletions pipelines/batch/setup_parameter_inference_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from azuretools.client import get_batch_service_client
from azuretools.job import create_job_if_not_exists
from azuretools.task import get_container_settings, get_task_config
from forecasttools import location_table


def main(
Expand Down Expand Up @@ -148,16 +149,9 @@ def main(
"'"
)

# to be replaced by forecasttools-py table
locations = pl.read_csv(
"https://www2.census.gov/geo/docs/reference/state.txt", separator="|"
)
loc_abbrs = location_table.get_column("short_name").to_list()

all_locations = [
loc
for loc in ["US"] + locations.get_column("STUSAB").to_list()
if loc not in excluded_locations
]
all_locations = [loc for loc in loc_abbrs if loc not in excluded_locations]

for disease, state in itertools.product(disease_list, all_locations):
task = get_task_config(
Expand Down
8 changes: 2 additions & 6 deletions pipelines/batch/setup_prod_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from azuretools.client import get_batch_service_client
from azuretools.job import create_job_if_not_exists
from azuretools.task import get_container_settings, get_task_config
from forecasttools import location_table


def main(
Expand Down Expand Up @@ -176,12 +177,7 @@ def main(
"'"
)

# to be replaced by forecasttools-py table
locations = pl.read_csv(
"https://www2.census.gov/geo/docs/reference/state.txt", separator="|"
)

loc_abbrs = locations.get_column("STUSAB").to_list() + ["US"]
loc_abbrs = location_table.get_column("short_name").to_list()
if locations_include is None:
locations_include = loc_abbrs
if locations_exclude is None:
Expand Down

0 comments on commit 098a1fb

Please sign in to comment.