Skip to content
Open
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
62 changes: 23 additions & 39 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,62 +14,46 @@ env:
jobs:
foundation:

strategy:
matrix:
python-version: ["3.10"]
defaults:
run:
shell: bash -l {0}
name: linux-64-py${{ matrix.python-version }}
name: linux-64
runs-on: ubuntu-latest
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-sandag-abm3'
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: 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
# 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 env update -n asim-test -f activitysim/conda-environments/github-actions-tests.yml
if: steps.cache.outputs.cache-hit != 'true'
uv pip install --no-deps ./cloned/activitysim

- 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
run: |
mamba info -a
mamba list
- name: Test this implementation
run: |
cd activitysim-sandag-abm3/test
python -m pytest test_sandag_abm3.py::test_sandag_abm3_progressive
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
2 changes: 2 additions & 0 deletions configs/resident/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ distributed_time_factor_nonwork_stddev: 0.6
distributed_time_factor_min: 0.1
distributed_time_factor_max: 10

check_model_settings: True

models:
### mp_init_proto_pop (single process)
- initialize_proto_population # Separate step so proto tables can be split for multiprocess.
Expand Down
4 changes: 3 additions & 1 deletion configs/resident/settings_mp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ memory_profile: False
# (Shadow pricing requires fail_fast setting in multiprocessing mode)
fail_fast: True

resume_after:
resume_after:

check_model_settings: True

models:
### mp_init_proto_pop (single process)
Expand Down
1 change: 1 addition & 0 deletions extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
from . import transponder_ownership
from . import airport_returns
from . import adjust_auto_operating_cost
from . import settings_checker
60 changes: 60 additions & 0 deletions extensions/settings_checker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
from .av_ownership import AVOwnershipSettings
from .external_identification import ExternalIdentificationSettings
from .transponder_ownership import TransponderOwnershipSettings

from activitysim.core.configuration.base import PydanticReadable
from activitysim.core.configuration.logit import (
TourLocationComponentSettings,
TourModeComponentSettings,
)
from activitysim.core.workflow import State



### SETTINGS FORMAT ###
### {"<model_name>": {"settings_cls": <PydanticSettings Object>, "settings_file": "<name of YAML file"}}
### If a specific Pydantic data model is not defined, map to PydanticReadable to expose .read_settings_file() method
### If required, an alternate set of spec/coefficients to resolve together can be defined for a model using
### "spec_coefficient_keys": [{"spec": "OUTBOUND_SPEC", "coefs": "OUTBOUND_COEFFICIENTS"}, ...]
EXTENSION_CHECKER_SETTINGS = {
"airport_returns": {
"settings_cls": PydanticReadable,
"settings_file": "airport_returns.yaml"
},
"av_ownership": {
"settings_cls": AVOwnershipSettings,
"settings_file": "av_ownership.yaml"
},
"external_student_identification": {
"settings_cls": ExternalIdentificationSettings,
"settings_file": "external_student_identification.yaml"
},
"external_non_mandatory_tour_identification": {
"settings_cls": ExternalIdentificationSettings,
"settings_file": "external_non_mandatory_identification.yaml"
},
"external_joint_tour_identification": {
"settings_cls": ExternalIdentificationSettings,
"settings_file": "external_joint_tour_identification.yaml"
},
"external_school_location": {
"settings_cls": TourLocationComponentSettings,
"settings_file": "external_school_location.yaml"
},
"external_workplace_location": {
"settings_cls": TourLocationComponentSettings,
"settings_file": "external_workplace_location.yaml"
},
"external_non_mandatory_destination": {
"settings_cls": TourLocationComponentSettings,
"settings_file": "external_non_mandatory_destination.yaml"
},
"external_joint_tour_destination": {
"settings_cls": TourLocationComponentSettings,
"settings_file": "external_joint_tour_destination.yaml"
},
"transponder_ownership": {
"settings_cls": TransponderOwnershipSettings,
"settings_file": "transponder_ownership.yaml"
},
}
26 changes: 26 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[project]
name = "sandag-abm3-example"
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",
]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion test/test_sandag_abm3.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def test_sandag_abm3_progressive(use_sharrow):
output_dir=out_dir,
settings=settings,
)
state.import_extensions("../extensions")
state.import_extensions("extensions")
state.filesystem.persist_sharrow_cache()
state.logging.config_logger()

Expand Down
Loading