Skip to content
Draft
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
8 changes: 4 additions & 4 deletions .github/workflows/pipeline-run-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
for disease in COVID-19 Influenza RSV; do
for location in US CA MT DC; do
echo "Fitting EpiAutoGP weekly NHSN model for $disease, $location"
uv run bash pipelines/tests/test_epiautogp_fit.sh ${{ env.BASE_DIR }} \
bash pipelines/tests/test_epiautogp_fit.sh ${{ env.BASE_DIR }} \
"$disease" "$location" nhsn epiweekly
done
done
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
for disease in COVID-19 Influenza RSV; do
for location in US CA MT DC; do
echo "Fitting EpiAutoGP weekly NSSP percentage model for $disease, $location"
uv run bash pipelines/tests/test_epiautogp_fit.sh ${{ env.BASE_DIR }} \
bash pipelines/tests/test_epiautogp_fit.sh ${{ env.BASE_DIR }} \
"$disease" "$location" nssp epiweekly pct
done
done
Expand Down Expand Up @@ -159,7 +159,7 @@ jobs:
for disease in COVID-19 Influenza RSV; do
for location in US CA MT DC; do
echo "Fitting EpiAutoGP daily NSSP count model for $disease, $location"
uv run bash pipelines/tests/test_epiautogp_fit.sh ${{ env.BASE_DIR }} \
bash pipelines/tests/test_epiautogp_fit.sh ${{ env.BASE_DIR }} \
"$disease" "$location" nssp daily observed
done
done
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
for disease in COVID-19 Influenza RSV; do
for location in US CA MT DC; do
echo "Fitting EpiAutoGP daily NSSP other ED visits model for $disease, $location"
uv run bash pipelines/tests/test_epiautogp_fit.sh ${{ env.BASE_DIR }} \
bash pipelines/tests/test_epiautogp_fit.sh ${{ env.BASE_DIR }} \
"$disease" "$location" nssp daily other
done
done
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,7 @@ jobs:
- name: Run EpiAutoGP parquet interop test
run: |
uv run pytest pipelines/tests/test_epiautogp_parquet_interop.py -q
- name: Run direct NowcastAutoGP juliacall parquet test
run: |
uv run --no-dev --group test --group epiautogp-julia pytest pipelines/tests/test_epiautogp_juliacall_runner_parquet.py -q
44 changes: 11 additions & 33 deletions pipelines/epiautogp/forecast_epiautogp.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
convert_to_epiautogp_json,
setup_forecast_pipeline,
)
from pipelines.epiautogp.juliacall_runner import run_nowcastautogp_forecast
from pipelines.utils.cli_utils import add_common_forecast_arguments
from pipelines.utils.common_utils import (
parse_exclude_date_ranges,
run_julia_code,
run_julia_script,
)


Expand All @@ -21,7 +20,7 @@ def run_epiautogp_forecast(
execution_settings: dict,
) -> None:
"""
Run EpiAutoGP forecasting model using Julia.
Run EpiAutoGP forecasting via NowcastAutoGP using juliacall.

Parameters
----------
Expand All @@ -40,7 +39,6 @@ def run_epiautogp_forecast(
- smc_data_proportion: Proportion of data used in each SMC step
execution_settings : dict
Execution settings for the Julia environment. Expected keys:
- project: Julia project name
- threads: Number of threads to use or "auto"

Returns
Expand All @@ -50,42 +48,22 @@ def run_epiautogp_forecast(
Raises
------
RuntimeError
If Julia environment setup or script execution fails
If Julia setup or model execution fails

Notes
-----
This function sets up the EpiAutoGP Julia environment and runs the
forecasting script. The output is saved to model_dir.
This function keeps the existing Python pipeline interface while delegating
the model fit and forecast to NowcastAutoGP through the internal juliacall
runner. The output is saved to model_dir.
"""
# Ensure output directory exists
model_dir.mkdir(parents=True, exist_ok=True)

# Instantiate julia environment for EpiAutoGP
run_julia_code(
"""
using Pkg
Pkg.activate("EpiAutoGP")
Pkg.instantiate()
""",
function_name="setup_epiautogp_environment",
)

# Add path arguments to pass to EpiAutoGP
params["json-input"] = str(json_input_path)
params["output-dir"] = str(model_dir)

# Convert Python dict keys (with underscores) to Julia CLI args (with hyphens)
args_to_epiautogp = [
f"--{key.replace('_', '-')}={value}" for key, value in params.items()
]
executor_flags = [f"--{key}={value}" for key, value in execution_settings.items()]

# Run Julia script
run_julia_script(
"EpiAutoGP/run.jl",
args_to_epiautogp,
executor_flags=executor_flags,
function_name="run_epiautogp_forecast",
run_nowcastautogp_forecast(
json_input_path=json_input_path,
model_dir=model_dir,
params=params,
execution_settings=execution_settings,
)
return None

Expand Down
Loading
Loading