Skip to content

Commit aa5f200

Browse files
authored
Fix estimation notebook tests (#8)
1 parent f50122a commit aa5f200

File tree

4 files changed

+49
-16
lines changed

4 files changed

+49
-16
lines changed

.github/workflows/core_tests.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -332,31 +332,36 @@ jobs:
332332
steps:
333333
- uses: actions/checkout@v4
334334

335+
- name: "Set up Python"
336+
uses: actions/setup-python@v5
337+
with:
338+
python-version-file: ".python-version"
339+
335340
- name: Install uv
336341
uses: astral-sh/setup-uv@v5
337342
with:
338343
version: "0.7.12"
339344
enable-cache: true
340345
cache-dependency-glob: "uv.lock"
341346

342-
- name: "Set up Python"
343-
uses: actions/setup-python@v5
344-
with:
345-
python-version-file: ".python-version"
347+
- name: setup graphviz
348+
uses: ts-graphviz/setup-graphviz@v2
346349

347350
- name: Install activitysim
348351
run: |
349-
uv sync --locked --only-group github-action
352+
uv sync --locked --group github-action
350353
351354
- name: Create Estimation Data
352-
run: |
353-
.venv\Scripts\python activitysim/examples/example_estimation/notebooks/est_mode_setup.py --household_sample_size 5000
355+
run: >
356+
uv run --group github-action python activitysim/examples/example_estimation/notebooks/est_mode_setup.py
357+
--household_sample_size 5000
354358
355359
- name: Test Estimation Notebooks
356-
run: |
357-
uv run pytest activitysim/examples/example_estimation/notebooks/*.ipynb \
358-
--nbmake-timeout=3000 \
359-
--ignore=activitysim/examples/example_estimation/notebooks/01_estimation_mode.ipynb
360+
run: >
361+
uv run --group github-action pytest activitysim/examples/example_estimation/notebooks
362+
--nbmake-timeout=3000
363+
--ignore=activitysim/examples/example_estimation/notebooks/01_estimation_mode.ipynb
364+
--ignore-glob=activitysim/examples/example_estimation/notebooks/test-estimation-data/**
360365
361366
estimation_edb_creation:
362367
needs: foundation
@@ -434,4 +439,4 @@ jobs:
434439
github_token: ${{ secrets.GITHUB_TOKEN }}
435440
# Token is created automatically by Github Actions, no other config needed
436441
publish_dir: ./docs/_build/html
437-
destination_dir: develop
442+
destination_dir: develop

activitysim/examples/example_estimation/build_full_mtc_example.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import os
3131
import shutil
3232
import subprocess
33+
import sys
3334
import time
3435
from pathlib import Path
3536

@@ -74,7 +75,7 @@ def main(working_dir: Path, household_sample_size: int, skip_to_edb: bool = Fals
7475

7576
subprocess.run(
7677
[
77-
"python",
78+
sys.executable,
7879
"-m",
7980
"activitysim",
8081
"run",
@@ -115,7 +116,7 @@ def main(working_dir: Path, household_sample_size: int, skip_to_edb: bool = Fals
115116

116117
subprocess.run(
117118
[
118-
"python",
119+
sys.executable,
119120
str(infer_py),
120121
str(pseudosurvey_dir),
121122
str(configs_dir),
@@ -132,7 +133,7 @@ def main(working_dir: Path, household_sample_size: int, skip_to_edb: bool = Fals
132133

133134
subprocess.run(
134135
[
135-
"python",
136+
sys.executable,
136137
"-m",
137138
"activitysim",
138139
"run",

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,13 @@ github-action = [
157157
"dask==2023.11",
158158
"isort==5.12.0",
159159
"nbmake==1.4.6",
160+
"pydot>=4.0.1",
160161
"pytest==7.2",
161162
"pytest-cov",
162163
"pytest-regressions",
163164
"requests>=2.32.3",
164165
"ruff",
166+
"xlsxwriter==3.2.5",
165167
"zarr>=2,<3",
166168
"zstandard",
167169
]

uv.lock

Lines changed: 26 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)