Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jpn-- authored Jul 25, 2023
2 parents d6aaf2d + 180dcca commit acca88a
Show file tree
Hide file tree
Showing 301 changed files with 16,864 additions and 9,157 deletions.
33 changes: 24 additions & 9 deletions .github/workflows/branch-docs.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name: ActivitySim Branch Docs
# This workflow is provided as a service for forks to build branch-specific documentation.

on: push
on:
- push
- workflow_dispatch

jobs:
docbuild:
if: "contains(github.event.head_commit.message, '[makedocs]') && (github.repository_owner != 'ActivitySim') && (github.ref_name != 'develop')"
# develop branch docs are built at the end of the core test workflow, regardless of repository owner or commit message flags
name: ubuntu-latest py3.9
name: ubuntu-latest py3.10
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -16,36 +18,49 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # get all tags, lets setuptools_scm do its thing
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies

- name: Setup Mambaforge
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
environment-file: conda-environments/docbuild.yml
python-version: 3.9
python-version: "3.10"
activate-environment: docbuild
auto-activate-base: false
auto-update-conda: false

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

- uses: actions/cache@v3
with:
path: /usr/share/miniconda3/envs/docbuild
key: linux-64-conda-${{ hashFiles('conda-environments/docbuild.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
id: cache

- name: Update environment
run: mamba env update -n docbuild -f conda-environments/docbuild.yml
if: steps.cache.outputs.cache-hit != 'true'

- name: Install activitysim
run: |
python -m pip install .
- name: Conda checkup
run: |
conda info -a
conda list
echo REPOSITORY ${{ github.repository }}
echo REF ${{ github.ref }}
echo REF_NAME ${{ github.ref_name }}
- name: Build the docs
run: |
cd docs
make clean
make html
- name: Push to GitHub Pages
uses: peaceiris/actions-gh-pages@v3.8.0
with:
Expand Down
100 changes: 82 additions & 18 deletions .github/workflows/core_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ on:
- '*'

env:
CACHE_NUMBER: 1 # increase to reset cache manually
CACHE_NUMBER: 0 # increase to reset cache manually

jobs:
foundation:

strategy:
matrix:
python-version: [3.9]
python-version: ["3.10"]
defaults:
run:
shell: bash -l {0}
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Set cache date for year and month
run: echo "DATE=$(date +'%Y%m')" >> $GITHUB_ENV

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: /usr/share/miniconda3/envs/asim-test
key: linux-64-conda-${{ hashFiles('conda-environments/github-actions-tests.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
Expand Down Expand Up @@ -81,6 +81,10 @@ jobs:
run: |
python -m pytest --pyargs activitysim.cli
- name: Test activitysim.examples.test
run: |
python -m pytest --pyargs activitysim.examples.test
cross-platform:
# also test foundation cross platforms, but do not require a successful
Expand All @@ -92,12 +96,12 @@ jobs:
- os: macos-latest
label: macOS
prefix: /Users/runner/miniconda3/envs/asim-test
python-version: 3.9
python-version: "3.10"

- os: windows-latest
label: win-64
prefix: C:\Miniconda3\envs\asim-test
python-version: 3.9
python-version: "3.10"

defaults:
run:
Expand All @@ -120,7 +124,7 @@ jobs:
- name: Set cache date for year and month
run: echo "DATE=$(date +'%Y%m')" >> $GITHUB_ENV

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ matrix.prefix }}
key: ${{ matrix.label }}-conda-${{ hashFiles('conda-environments/github-actions-tests.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
Expand Down Expand Up @@ -164,11 +168,11 @@ jobs:
python -m pytest --pyargs activitysim.cli
regional_models:
builtin_regional_models:
needs: foundation
env:
mamba-env-prefix: /usr/share/miniconda3/envs/asim-test
python-version: 3.9
python-version: "3.10"
label: linux-64
strategy:
matrix:
Expand Down Expand Up @@ -204,7 +208,7 @@ jobs:
- name: Set cache date for year and month
run: echo "DATE=$(date +'%Y%m')" >> $GITHUB_ENV

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ env.mamba-env-prefix }}
key: ${{ env.label }}-conda-${{ hashFiles('conda-environments/github-actions-tests.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
Expand Down Expand Up @@ -235,7 +239,7 @@ jobs:
# - name: Get a random number
# run: echo "RANDOM_SUFFIX=${RANDOM}${RANDOM}" >> $GITHUB_ENV
#
# - uses: actions/cache@v2
# - 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
Expand All @@ -253,11 +257,71 @@ jobs:
run: |
python -m pytest activitysim/examples/${{ matrix.region }}/test --durations=0
external_regional_models:
needs: foundation
env:
mamba-env-prefix: /usr/share/miniconda3/envs/asim-test
python-version: "3.10"
label: linux-64
strategy:
matrix:
region:
- prototype_mtc
- prototype_psrc_in_development
fail-fast: false
defaults:
run:
shell: bash -l {0}
name: ${{ matrix.region }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

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

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

- uses: actions/cache@v3
with:
path: |
${{ env.mamba-env-prefix }}
~/.cache/ActivitySim
key: ${{ env.label }}-conda-${{ hashFiles('conda-environments/github-actions-tests.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
id: cache

- name: Update environment
run: mamba env update -n asim-test -f 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 -e . --no-deps
- name: Conda checkup
run: |
mamba info -a
mamba list
- name: Test ${{ matrix.region }}
run: |
python -m activitysim test ${{ matrix.region }}
random_seed_generation:
needs: foundation
env:
mamba-env-prefix: /usr/share/miniconda3/envs/asim-test
python-version: 3.9
python-version: "3.10"
label: linux-64
defaults:
run:
Expand All @@ -280,7 +344,7 @@ jobs:
- name: Set cache date for year and month
run: echo "DATE=$(date +'%Y%m')" >> $GITHUB_ENV

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ env.mamba-env-prefix }}
key: ${{ env.label }}-conda-${{ hashFiles('conda-environments/github-actions-tests.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
Expand Down Expand Up @@ -310,7 +374,7 @@ jobs:
needs: foundation
env:
mamba-env-prefix: /usr/share/miniconda3/envs/asim-test
python-version: 3.9
python-version: "3.10"
label: linux-64
defaults:
run:
Expand All @@ -332,7 +396,7 @@ jobs:
- name: Set cache date for year and month
run: echo "DATE=$(date +'%Y%m')" >> $GITHUB_ENV

- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: ${{ env.mamba-env-prefix }}
key: ${{ env.label }}-conda-${{ hashFiles('conda-environments/github-actions-tests.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
Expand All @@ -343,7 +407,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'

- name: Install Larch
run: mamba install "larch>=5.5.3"
run: mamba install "larch>=5.7.1"

- name: Install activitysim
# installing without dependencies is faster, we trust that all needed dependencies
Expand Down Expand Up @@ -373,18 +437,18 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # get all tags, lets setuptools_scm do its thing
- name: Set up Python 3.9
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: 3.9
python-version: "3.10"
- name: Install dependencies
uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
environment-file: conda-environments/docbuild.yml
python-version: 3.9
python-version: "3.10"
activate-environment: docbuild
auto-activate-base: false
auto-update-conda: false
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,7 @@ _test_est
**/output/
**/_generated_version.py
docs/**/_generated
activitysim/examples/prototype_mtc_extended/test/*.ipynb
activitysim/examples/prototype_mtc/*.ipynb
Untitled.ipynb
docs/dev-guide/_generated2
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: end-of-file-fixer
exclude: .*\.ipynb
- id: trailing-whitespace

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]
Expand All @@ -18,7 +18,7 @@ repos:
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
#- repo: https://github.com/PyCQA/flake8
# rev: 5.0.4
# hooks:
# - id: flake8
3 changes: 3 additions & 0 deletions AAA-BreakingChanges.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@


- The 'run_list' key in settings.yaml is no longer supported.
3 changes: 2 additions & 1 deletion activitysim/abm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ActivitySim
# See full license in LICENSE.txt.
from . import misc, models, tables
from activitysim.abm import misc, models, tables
from activitysim.core.steps import output # also contains workflow.step # noqa: F401
Loading

0 comments on commit acca88a

Please sign in to comment.