Skip to content

Index names consistently set to "alt" for alternatives files #1093

Index names consistently set to "alt" for alternatives files

Index names consistently set to "alt" for alternatives files #1093

Workflow file for this run

name: Core Testing
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
workflow_dispatch:
env:
CACHE_NUMBER: 0 # increase to reset cache manually
jobs:
foundation:
defaults:
run:
shell: bash -l {0}
name: linux-64-py${{ matrix.python-version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install activitysim
run: |
uv sync --locked
- name: Lint with Black
run: |
# stop the build if there are problems
uv run black --check --diff .
- name: Test activitysim.core
run: |
uv run pytest --pyargs activitysim.core
- name: Test activitysim.abm.models
run: |
uv run pytest --pyargs activitysim.abm.models
- name: Test activitysim.abm.test
run: |
uv run pytest --pyargs activitysim.abm.test
- name: Test activitysim.cli
run: |
uv run pytest --pyargs activitysim.cli
- name: Test activitysim.examples.test
run: |
uv run pytest --pyargs activitysim.examples.test
cross-platform:
# also test foundation cross platforms, but do not require a successful
# completion before starting regional model tests
needs: foundation
strategy:
matrix:
include:
- os: macos-latest
label: macOS
python-version: "3.10"
- os: windows-latest
label: win-64
python-version: "3.10"
defaults:
run:
shell: bash -l {0}
name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install activitysim
run: |
uv sync --locked
- name: Lint with Black
run: |
# stop the build if there are problems
uv run black --check --diff .
- name: Test activitysim.core
run: |
uv run pytest --pyargs activitysim.core
- name: Test activitysim.abm.models
run: |
uv run pytest --pyargs activitysim.abm.models
- name: Test activitysim.abm.test
run: |
uv run pytest --pyargs activitysim.abm.test
- name: Test activitysim.cli
run: |
uv run pytest --pyargs activitysim.cli
- run: uv run pytest test/test_skim_name_conflicts.py
- run: uv run pytest test/random_seed/test_random_seed.py
builtin_regional_models:
needs: foundation
env:
python-version: "3.10"
label: win-64
strategy:
matrix:
region:
- prototype_mtc
- placeholder_psrc
- prototype_marin
- prototype_mtc_extended
- prototype_sandag_xborder
- production_semcog
- prototype_mwcog
- placeholder_multiple_zone
fail-fast: false
defaults:
run:
shell: pwsh
name: ${{ matrix.region }}
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install activitysim
run: |
uv sync --locked
# TODO: Cache sharrow compiled flows? The contents of __pycache__ appear to
# be ignored, so this is not working as expected right now
#
# - name: Define Inputs
# run: echo "REGION_DEFS=activitysim/examples/${{ matrix.region }}/** " >> $GITHUB_ENV
#
# - name: Get a random number
# run: echo "RANDOM_SUFFIX=${RANDOM}${RANDOM}" >> $GITHUB_ENV
#
# - uses: actions/cache@v3
# # store the regional model's cache directory in github actions cache
# # this will (almost) never hit on primary key due to the random number
# # but will pull the most recent cache from restore-keys... and then
# # update the cache with additional compiled flows as needed.
# # Hoping this will result in fewer re-compiles on tests and faster
# # testing overall
# with:
# path: activitysim/examples/${{ matrix.region }}/test/output/cache
# key: ${{ matrix.region }}-${{ env.label }}-${{ hashFiles(env.REGION_DEFS) }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}-${{ env.RANDOM_SUFFIX }}
# restore-keys: |
# ${{ matrix.region }}-${{ env.label }}-${{ hashFiles(env.REGION_DEFS) }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
# id: cache-example
- name: Test ${{ matrix.region }}
run: |
uv run pytest activitysim/examples/${{ matrix.region }}/test --durations=0
external_regional_models:
needs: foundation
env:
python-version: "3.10"
label: win-64
strategy:
matrix:
include:
- region: Standard 1-Zone Example (MTC)
region-org: ActivitySim
region-repo: activitysim-prototype-mtc
region-branch: pandas2
- region: Standard 2-Zone Example (SANDAG)
region-org: ActivitySim
region-repo: sandag-abm3-example
region-branch: main
fail-fast: false
defaults:
run:
shell: pwsh
name: ${{ matrix.region }}
runs-on: windows-latest
steps:
- name: Checkout ActivitySim
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install activitysim
run: |
uv sync --locked
- name: Checkout Example
uses: actions/checkout@v4
with:
repository: '${{ matrix.region-org }}/${{ matrix.region-repo }}'
ref: '${{ matrix.region-branch }}'
path: '${{ matrix.region-repo }}'
- name: Test ${{ matrix.region }}
run: |
cd ${{ matrix.region-repo }}
uv run --project .. --locked pytest ./test
random_seed_generation:
needs: foundation
env:
python-version: "3.10"
label: win-64
defaults:
run:
shell: pwsh
name: random_seed_generation_test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install activitysim
run: |
uv sync --locked
- name: Test Random Seed Generation
run: |
uv run pytest test/random_seed/test_random_seed.py --durations=0
estimation_mode:
needs: foundation
env:
python-version: "3.10"
label: win-64
defaults:
run:
shell: pwsh
name: Estimation Mode Unit Tests
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install activitysim
run: |
uv sync --locked
- name: Test Estimation Mode
run: |
uv run pytest activitysim/estimation/test/test_larch_estimation.py --durations=0
estimation_notebooks:
needs: foundation
env:
python-version: "3.10"
label: win-64
defaults:
run:
shell: pwsh
name: Estimation Notebooks Test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: setup graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Install activitysim
run: |
uv sync --locked
- name: Create Estimation Data
run: >
uv run python activitysim/examples/example_estimation/notebooks/est_mode_setup.py
--household_sample_size 5000
- name: Test Estimation Notebooks
run: >
uv run pytest activitysim/examples/example_estimation/notebooks
--nbmake-timeout=3000
--ignore=activitysim/examples/example_estimation/notebooks/01_estimation_mode.ipynb
--ignore-glob=activitysim/examples/example_estimation/notebooks/test-estimation-data/**
estimation_edb_creation:
needs: foundation
env:
python-version: "3.10"
label: win-64
defaults:
run:
shell: pwsh
name: estimation_edb_creation_test
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install activitysim
run: |
uv sync --locked
- name: Test Estimation EDB Creation
run: |
uv run pytest activitysim/estimation/test/test_edb_creation/test_edb_formation.py --durations=0
expression-profiling:
needs: foundation
env:
python-version: "3.10"
label: win-64
defaults:
run:
shell: pwsh
name: Expression Profiling Tests
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install activitysim
run: |
uv sync --locked
- name: Test Expression Profiling
run: |
uv run pytest test/test_expression_profiling.py
develop-docbuild:
needs: foundation
if: github.ref_name == 'main' || github.ref_name == 'docs-fix'
name: develop-docbuild
runs-on: ubuntu-latest
permissions:
contents: write
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # get all tags, lets setuptools_scm do its thing
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.7.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: "Set up Python"
uses: actions/setup-python@v5
with:
python-version-file: ".python-version"
- name: Install activitysim
run: |
uv sync --locked
- name: localize version switcher
run: |
python .github/workflows/localize-base-urls.py docs/_static/switcher.json
git update-index --assume-unchanged docs/_static/switcher.json
cat docs/_static/switcher.json
- name: Build the docs
run: |
cd docs
make clean
make html
- name: Push to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Token is created automatically by Github Actions, no other config needed
publish_dir: ./docs/_build/html
destination_dir: develop