Skip to content
Merged
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
57 changes: 21 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,52 +25,37 @@ jobs:
steps:
# checkout the code in this repository
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: "0.8.8"
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: "Set up Python"
uses: actions/setup-python@v5
with:
path: 'activitysim-prototype-mtc'
python-version-file: ".python-version"

- name: Install everything
run: |
uv sync --locked

# checkout the main branch of ActivitySim itself
- uses: actions/checkout@v4
with:
repository: 'ActivitySim/activitysim'
ref: main
path: 'activitysim'
path: 'cloned/activitysim'
fetch-depth: 0 # get all tags, lets setuptools_scm do its thing

- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
activate-environment: asim-test
use-mamba: true
python-version: ${{ matrix.python-version }}

- name: Set cache date for year and month
run: echo "DATE=$(date +'%Y%m')" >> $GITHUB_ENV

- uses: actions/cache@v4
with:
path: /usr/share/miniconda3/envs/asim-test
key: linux-64-conda-${{ hashFiles('activitysim/conda-environments/github-actions-tests.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
id: cache

- name: Update environment
run: |
mamba env update -n asim-test -f activitysim/conda-environments/github-actions-tests.yml
if: steps.cache.outputs.cache-hit != 'true'

- name: Install activitysim
# installing without dependencies is faster, we trust that all needed dependencies
# are in the conda environment defined above. Also, this avoids pip getting
# confused and reinstalling tables (pytables).
run: |
python -m pip install ./activitysim --no-deps

- name: Conda checkup
# install ActivitySim, overriding the one in the workspace,
# as the pre-installed one is the latest release but not the most up-to-date
- name: Install ActivitySim
run: |
mamba info -a
mamba list
uv pip install --no-deps ./cloned/activitysim

- name: Test this implementation
run: |
python -m pytest activitysim-prototype-mtc/test
uv run pytest ./test
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[project]
name = "activitysim-prototype-mtc"
version = "1.4"
description = "User environment for Prototype MTC Model"
readme = "README.md"
requires-python = ">=3.10,<3.12"
dependencies = [
"activitysim==1.4",
"multimethod<2.0",
"numba>=0.57",
"numpy>=1.16.1,<1.26",
"openmatrix>=0.3.5.0",
"pandas>=2.1.0",
"pandera>=0.15,<0.18.1",
"psutil>=4.1",
"pydantic>=2.6",
"setuptools>=80.9.0,<81",
"sharrow>=2.14.0",
"tables>=3.9",
]

[dependency-groups]
dev = [
"pytest>=8.4.1",
"zstandard>=0.23.0",
]
19 changes: 19 additions & 0 deletions scripts/download_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from pathlib import Path
from activitysim.examples.external import download_external_example

example_dir = download_external_example(
name="prototype_mtc_extended",
working_dir=Path.cwd(),
url="https://github.com/ActivitySim/activitysim-prototype-mtc/archive/refs/heads/extended.tar.gz",
assets={
"data_full.tar.zst": {
"url": "https://github.com/ActivitySim/activitysim-prototype-mtc/releases/download/v1.3.4/data_full.tar.zst",
"sha256": "b402506a61055e2d38621416dd9a5c7e3cf7517c0a9ae5869f6d760c03284ef3",
"unpack": "data_full",
},
"test/prototype_mtc_reference_pipeline.zip": {
"url": "https://github.com/ActivitySim/activitysim-prototype-mtc/releases/download/v1.3.2/prototype_mtc_extended_reference_pipeline.zip",
"sha256": "4d94b6a8a83225dda17e9ca19c9110bc1df2df5b4b362effa153d1c8d31524f5",
},
},
)
Binary file removed test/--prototype_mtc_reference_pipeline.zip
Binary file not shown.
Binary file modified test/reference-pipeline-extended-recodeFalse.zip
Binary file not shown.
Binary file modified test/reference-pipeline-extended-recodeTrue.zip
Binary file not shown.
1,767 changes: 1,767 additions & 0 deletions uv.lock

Large diffs are not rendered by default.