Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Phase 7] Sharrow -- 1 Zone #579

Closed
wants to merge 243 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
c4edff8
sharrow changes initial dump
jpn-- Mar 1, 2022
37de71c
fix for dot function
jpn-- Mar 1, 2022
ad36d4c
fix for sharrow 2.0
jpn-- Mar 3, 2022
9308a7e
require sharrow and xarray
jpn-- Mar 3, 2022
53489e4
include sh configs in example_mtc
jpn-- Mar 9, 2022
d3dcb80
thread stopper when invoking activitysim1
jpn-- Mar 11, 2022
e389254
sh for arc examples
jpn-- Mar 11, 2022
7770352
sharrow now allows one missing dim
jpn-- Mar 12, 2022
a6e21fe
recode TAZ's
jpn-- Mar 12, 2022
c6ef5c7
clean up logging
jpn-- Mar 12, 2022
873bb17
comment out traps in ARC model
jpn-- Mar 13, 2022
a17a532
pypyr
jpn-- Mar 14, 2022
10d9444
workflow updates
jpn-- Mar 14, 2022
60cdafc
archives in one dir
jpn-- Mar 15, 2022
7e3dffb
demo workflow
jpn-- Mar 17, 2022
341c569
facilitate pypyr as optional
jpn-- Mar 17, 2022
293e30f
remove nested wheres
jpn-- Mar 17, 2022
ee5e9b6
tweaks for ARC model
jpn-- Mar 17, 2022
924466e
prog and parser for docs
jpn-- Mar 17, 2022
724b27f
create --link
jpn-- Mar 17, 2022
09834c2
use --link in workflow
jpn-- Mar 17, 2022
52b92a4
norm link paths
jpn-- Mar 18, 2022
6acebc5
exit with error code on failure
jpn-- Mar 18, 2022
e1465de
fallback to copy if lacking windows permissions
jpn-- Mar 18, 2022
d9c6318
sys exit with failure on uncaught exception
jpn-- Mar 18, 2022
a674a37
call correct python
jpn-- Mar 18, 2022
a9e4439
don't swallow errors
jpn-- Mar 18, 2022
ca397e9
enable vt support
jpn-- Mar 18, 2022
bc3b9ed
re-install previously downloaded files
jpn-- Mar 18, 2022
bd3124e
archive_base
jpn-- Mar 18, 2022
80346d6
use rich
jpn-- Mar 18, 2022
e6bec7e
optional name for skims backing store
jpn-- Mar 18, 2022
5d86dcb
workflow cleanup
jpn-- Mar 21, 2022
6330aa2
small adjustments
jpn-- Mar 21, 2022
de39406
toggle sharrow in workflow
jpn-- Mar 22, 2022
14f0d95
decode TAZ on output
jpn-- Mar 22, 2022
e36d5d5
integerize decodings
jpn-- Mar 23, 2022
8cee8b1
resume_after in workflow
jpn-- Mar 23, 2022
ce2a05e
recode_pipeline_columns
jpn-- Mar 23, 2022
af07364
fix script
jpn-- Mar 23, 2022
8acc4c5
fixes for parking location
jpn-- Mar 23, 2022
81aa255
zarr pre-encoding
jpn-- Mar 24, 2022
519e71b
workflow updates
jpn-- Mar 24, 2022
ebad8ea
cleanup for --no-rich
jpn-- Mar 24, 2022
1216033
zarr logging
jpn-- Mar 24, 2022
a35bf68
compile_watch, standalones
jpn-- Mar 25, 2022
4c0e35d
fix example_runner
jpn-- Mar 25, 2022
5a74764
county workforce flows
jpn-- Mar 28, 2022
cd3add0
workflow mods
jpn-- Mar 31, 2022
85c13c4
fix compare in ARC
jpn-- Apr 1, 2022
1185449
run_flags
jpn-- Apr 1, 2022
ea54b52
reporting as steps
jpn-- Apr 1, 2022
8d43649
to_csv_safe
jpn-- Apr 4, 2022
31f56f7
data inv in report
jpn-- Apr 4, 2022
b051bbb
load 5 tables
jpn-- Apr 4, 2022
ed3a529
improve formatting
jpn-- Apr 4, 2022
e74674c
distance in report
jpn-- Apr 4, 2022
7563dd8
attach skim data
jpn-- Apr 5, 2022
b51cc33
report_step 1
jpn-- Apr 6, 2022
d46fd49
more validation viz
jpn-- Apr 6, 2022
4432b4c
tablesets
jpn-- Apr 7, 2022
43f56d2
semcog cleanup 1
jpn-- Apr 7, 2022
515a619
adjustments for semcog model
jpn-- Apr 8, 2022
2d93b61
transform_data
jpn-- Apr 8, 2022
89830a5
cdap to report
jpn-- Apr 8, 2022
b9a9ba4
instrument, workstep
jpn-- Apr 9, 2022
462eedf
semcog string eval to preprocessor
jpn-- Apr 11, 2022
0d962b1
no at in preprocessor
jpn-- Apr 11, 2022
e309589
temp tour_mode
jpn-- Apr 11, 2022
ec106ef
skims not in preproc
jpn-- Apr 11, 2022
854dbbc
sigh
jpn-- Apr 11, 2022
bfdfe57
deoptimize for compatibility
jpn-- Apr 11, 2022
8318fc6
prioritize explicit return_names
jpn-- Apr 11, 2022
0fc20fb
clean up
jpn-- Apr 11, 2022
4f88459
cleanup
jpn-- Apr 11, 2022
24f0edb
ordinal_distribution
jpn-- Apr 12, 2022
540d706
Merge commit 'b3d1d61e4a0f88a6230fd389c083d3a995c0ae34' into with-sha…
jpn-- Apr 12, 2022
d57299b
start on two-zone
jpn-- Apr 18, 2022
63d30b2
psrc reaches first flow
jpn-- Apr 25, 2022
51cf259
clean up dims
jpn-- Apr 25, 2022
4b36afa
two zone yay?
jpn-- Apr 25, 2022
3d7ca89
work on 2-zone, clean up interface
jpn-- May 16, 2022
5d08c6e
version tag from scm
jpn-- May 16, 2022
dc6a3c3
move modules to reporting
jpn-- May 16, 2022
4337914
install env, run as subprocess
jpn-- May 17, 2022
998bfb4
reference in env
jpn-- May 17, 2022
a48d021
skip missing cols in composite_log
jpn-- May 17, 2022
3f11b69
mtc_full ref
jpn-- May 17, 2022
9bffcd7
fix reference run
jpn-- May 18, 2022
7e858e9
relabel tablesets
jpn-- May 18, 2022
5db361b
workplace location w data dict
jpn-- May 18, 2022
f7f23e6
create docs
jpn-- May 18, 2022
a77deb0
doc cleanup
jpn-- May 18, 2022
88d046a
reorg, memory use
jpn-- May 18, 2022
9e21b6c
arc with legacy-1.0.4
jpn-- May 18, 2022
7ecb7d8
use shell for env install
jpn-- May 18, 2022
1e660d5
flag progression on env
jpn-- May 18, 2022
fbdca0a
pass args as string for shell
jpn-- May 18, 2022
911cd7b
log shell command
jpn-- May 18, 2022
0681721
make intermediate dirs [ci skip]
jpn-- May 18, 2022
1e78b45
fix for windows
jpn-- May 18, 2022
7d69a21
fix reporting for 1 run on windows
jpn-- May 19, 2022
3e365e3
subproc single thread by default [ci skip]
jpn-- May 19, 2022
640ac0e
fix random to old repro
jpn-- Jun 1, 2022
72b4671
memory sidecar
jpn-- Jun 1, 2022
a84db1e
show me
jpn-- Jun 1, 2022
29dabfe
record CPU usage
jpn-- Jun 1, 2022
731dc07
peak mem use report
jpn-- Jun 1, 2022
68bf709
arc contrasts
jpn-- Jun 1, 2022
b72594b
arc outputs
jpn-- Jun 1, 2022
645450a
no resume_after if no breadcrumbs
jpn-- Jun 1, 2022
67cf14e
fix arc full hh num
jpn-- Jun 2, 2022
f15ba72
chunk training mode def in workflow
jpn-- Jun 2, 2022
a88b0d6
resilient sidecar
jpn-- Jun 2, 2022
dbbba06
stream mp output via temp file
jpn-- Jun 2, 2022
548f9fd
machine_info in report
jpn-- Jun 3, 2022
2e52023
config flag to disable zarr
jpn-- Jun 3, 2022
649955f
remove extra CR for windows
jpn-- Jun 3, 2022
4ee8d6e
demo memory stress test
jpn-- Jun 3, 2022
f04b9e9
report settings
jpn-- Jun 5, 2022
4f2d6b2
no memory profile on multiprocess
jpn-- Jun 5, 2022
2c54d0c
extra timing log points for multiprocess
jpn-- Jun 5, 2022
704766e
fix redownload error
jpn-- Jun 5, 2022
689de8a
allow multi_thread
jpn-- Jun 5, 2022
2dec68e
disable_zarr and report settings
jpn-- Jun 5, 2022
e2478cd
blacken
jpn-- Jun 5, 2022
7dfcb53
remove pointless assertions
jpn-- Jun 7, 2022
8059286
fix timetable tests for optimized code
jpn-- Jun 7, 2022
93e9d58
changed error message
jpn-- Jun 7, 2022
75c257f
Merge branch 'develop' into with-sharrow
jpn-- Jun 7, 2022
68a0fe3
blacken
jpn-- Jun 7, 2022
db78bcd
require pypyr for workflows
jpn-- Jun 8, 2022
52f8546
test TAZ recode in legacy model
jpn-- Jun 8, 2022
491d65e
test sharrow
jpn-- Jun 8, 2022
e4eaa0a
require sharrow 2.2
jpn-- Jun 10, 2022
184dfc4
include pypyr, zarr in test envs
jpn-- Jun 10, 2022
1730085
check for travis
jpn-- Jun 13, 2022
b07757a
don't let coveralls fail tasks
jpn-- Jun 13, 2022
769f0ab
auto offest_preprocessing detection, ARC tests
jpn-- Jun 14, 2022
242f0d1
cache arc test for travis
jpn-- Jun 14, 2022
736def4
offset_preprocessing for pipeline load
jpn-- Jun 14, 2022
5ef9723
exclude sharrow cached flows from pycodestyle
jpn-- Jun 14, 2022
697704d
tests in github actions
jpn-- Jun 14, 2022
880edac
use unique env file
jpn-- Jun 14, 2022
5722749
install without deps
jpn-- Jun 14, 2022
007eaf2
other core tests
jpn-- Jun 14, 2022
3b57e22
fix sandag tests
jpn-- Jun 15, 2022
b389ad0
add mtc tests to GA
jpn-- Jun 15, 2022
c55bf08
top constrain pytables
jpn-- Jun 15, 2022
aab5529
fix psrc test
jpn-- Jun 15, 2022
b2389b1
sharrowcache
jpn-- Jun 15, 2022
843c959
matrixed example models
jpn-- Jun 16, 2022
65c9b6b
nested hashing
jpn-- Jun 16, 2022
c1cb409
better name
jpn-- Jun 16, 2022
bfa533d
comprehensive regional test matrix
jpn-- Jun 16, 2022
77fdeff
fix workflow
jpn-- Jun 16, 2022
9e78765
don't fail-fast on regional models, depend only on linux foundation
jpn-- Jun 16, 2022
3893bc9
fix GA
jpn-- Jun 16, 2022
cfb2288
fix for multizone on GA
jpn-- Jun 16, 2022
22a0f4f
REGION_DEFS
jpn-- Jun 16, 2022
2c0e0d2
reset cache
jpn-- Jun 17, 2022
f940cf5
repair sandag xborder model
jpn-- Jun 17, 2022
4da3c61
blacken
jpn-- Jun 17, 2022
4c54c9e
fix macos cache
jpn-- Jun 17, 2022
cb15d7f
aggressive caching
jpn-- Jun 17, 2022
d1a212c
unpin numpy
jpn-- Jun 19, 2022
11303ab
test estimation, cache artifacts
jpn-- Jun 20, 2022
a73a746
sandag sharrow testing
jpn-- Jun 21, 2022
ec8d2de
sandag-1zone-mini
jpn-- Jun 22, 2022
85e5059
init chunked workflow
jpn-- Jun 22, 2022
25b46a0
sandag-1zone-complete
jpn-- Jun 22, 2022
876c18a
bugfix
jpn-- Jun 22, 2022
60b1c50
chunked sandag 1
jpn-- Jun 22, 2022
37e8533
warn dont fail
jpn-- Jun 23, 2022
3977f89
workflow updates
jpn-- Jun 23, 2022
773caba
skipable chunk training
jpn-- Jun 24, 2022
c867921
blacken
jpn-- Jun 24, 2022
02311b2
chunk size detection
jpn-- Jul 12, 2022
3bfa43c
use settings_file in compile
jpn-- Jul 12, 2022
4bc5b47
fix recursion
jpn-- Jul 12, 2022
aa21cd0
fix deadlock in reference MP
jpn-- Jul 13, 2022
8b53ca6
blacken
jpn-- Jul 13, 2022
b0fd70a
comprehensive workflow
jpn-- Jul 13, 2022
22b5efa
Ensure integer types for numbers
jpn-- Jul 13, 2022
ec98d75
add memory_profiling to comprehensive
jpn-- Jul 13, 2022
5fadb20
add ARC single thread to comprehensive
jpn-- Jul 13, 2022
4e42bb4
workflow notes
jpn-- Jul 13, 2022
60e06ef
repair integers
jpn-- Jul 14, 2022
5eef3d2
avoid interaction_df in interaction_simulate if no skims or tracing
jpn-- Jul 14, 2022
14ff73e
trim memory peak in time table
jpn-- Jul 14, 2022
b2abd06
forced garbage collection option
jpn-- Jul 14, 2022
024539a
short circuit chunk logic on disabled chunking
jpn-- Jul 15, 2022
fcf905a
swallow errors in workflow
jpn-- Jul 15, 2022
7eada19
settings for mtc_comprehensive
jpn-- Jul 15, 2022
675ede0
fix num_processes
jpn-- Jul 15, 2022
b9e23ff
sandag mp chunked
jpn-- Jul 15, 2022
0ed85e4
sandag create for mp
jpn-- Jul 15, 2022
effc637
workflow name for chunked
jpn-- Jul 15, 2022
c084425
swallow errors in chunked
jpn-- Jul 16, 2022
ea902a4
seperate chunk cache for legacy and sharrow
jpn-- Jul 22, 2022
1969f87
default chunk size should be None
jpn-- Jul 22, 2022
cf687d9
documentation cleanup
jpn-- Jul 22, 2022
4ec5531
build docs
jpn-- Jul 22, 2022
89e5e34
dummy code in setup.py
jpn-- Jul 22, 2022
0f36391
docbuild env
jpn-- Jul 23, 2022
2367ecc
blacken
jpn-- Jul 23, 2022
b3aaf4a
clean up workflow
jpn-- Jul 23, 2022
632d88b
cache separate leg and sh
jpn-- Jul 23, 2022
890861d
fix assertion error when chunking is disabled and adaptive chunking i…
jpn-- Jul 23, 2022
d048ead
blacken
jpn-- Jul 23, 2022
17ea961
repair fallback version
jpn-- Jul 25, 2022
e819d07
sandag 1zone mp workflow
jpn-- Jul 25, 2022
998e231
arc_mp
jpn-- Jul 27, 2022
e8fcb12
fix cols on ARC
jpn-- Jul 27, 2022
107e270
turn on chunk training by default
jpn-- Aug 1, 2022
8fc3041
Merge branch 'develop' into sharrow-black
jpn-- Aug 6, 2022
618413d
fix merge error
jpn-- Aug 6, 2022
4f12df4
change linter to Black
jpn-- Aug 6, 2022
86850f2
merge error, lost timing notes
jpn-- Aug 6, 2022
77ea21e
merge error in testing
jpn-- Aug 6, 2022
be4de1f
install black in Github Actions
jpn-- Aug 6, 2022
7d1da5f
black and isort again
jpn-- Aug 6, 2022
f61db75
ignore _generated_version.py
jpn-- Aug 6, 2022
f5fa6c7
testing cleanup
jpn-- Aug 6, 2022
ec9a50b
pre-commit hooks
jpn-- Aug 6, 2022
90e659c
blacken, flake8 config
jpn-- Aug 6, 2022
4fb702c
fix regional test names for new scheme
jpn-- Aug 6, 2022
c52496f
clean naming
jpn-- Aug 6, 2022
d0cff5d
black linting on crossplatform
jpn-- Aug 6, 2022
da2172f
re-enable sharrow testing
jpn-- Aug 6, 2022
468270b
stop emitting output dir
jpn-- Aug 6, 2022
74b1465
trace files in nested directories
jpn-- Aug 7, 2022
bd326f9
allow unused vars
jpn-- Aug 7, 2022
6720179
fix merge problems in proto mtc
jpn-- Aug 7, 2022
3b12814
swap files for xborder model
jpn-- Aug 7, 2022
e92ac72
repair ARC MP
jpn-- Aug 8, 2022
8784e35
Merge commit 'e92ac727454b1f1027fb7146a1ef130be1509580' into sharrow-…
jpn-- Aug 8, 2022
844eec2
remove run_flags
jpn-- Aug 8, 2022
dc9d7f5
settings docs
jpn-- Aug 9, 2022
633a362
add new settings to docs
jpn-- Aug 9, 2022
345fe8a
docs update for publishing on CS fork
jpn-- Aug 9, 2022
ed8dcff
update docs to ref black not pycodestyle
jpn-- Aug 9, 2022
982fdb6
protect memory profile
jpn-- Sep 12, 2022
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
51 changes: 51 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: ActivitySim Docs

on:
push:
branches: [ main, develop, sharrow-black ]
workflow_dispatch:

jobs:
docbuild:
if: ${{ github.repository }} == "camsys/activitysim"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should clean up these references before merging.

name: ubuntu-latest py3.9
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- 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
activate-environment: docbuild
auto-activate-base: false
auto-update-conda: false
- name: Install activitysim
run: |
python -m pip install -e .
- name: Conda checkup
run: |
conda info -a
conda list
echo ${{ github.repository }}
- name: Build the docs
run: |
cd docs
make clean
make html
- name: Push to GitHub Pages
uses: peaceiris/actions-gh-pages@v3.5.9
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Token is created automatically by Github Actions, no other config needed
publish_dir: ./docs/_build/html
308 changes: 308 additions & 0 deletions .github/workflows/core_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,308 @@
name: core-tests

on:
push:
branches:
- '*'

pull_request:
branches:
- '*'

env:
CACHE_NUMBER: 1 # increase to reset cache manually

jobs:
foundation:

strategy:
matrix:
python-version: [3.9]
defaults:
run:
shell: bash -l {0}
name: linux-64-py${{ matrix.python-version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- 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: ${{ matrix.python-version }}

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

- uses: actions/cache@v2
with:
path: /usr/share/miniconda3/envs/asim-test
key: linux-64-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: Lint with Black
run: |
# stop the build if there are problems
black --check --diff .

- name: Test activitysim.core
run: |
python -m pytest --pyargs activitysim.core

- name: Test activitysim.abm.models
run: |
python -m pytest --pyargs activitysim.abm.models

- name: Test activitysim.abm.test
run: |
python -m pytest --pyargs activitysim.abm.test

- name: Test activitysim.cli
run: |
python -m pytest --pyargs activitysim.cli


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
prefix: /Users/runner/miniconda3/envs/asim-test
python-version: 3.9

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

defaults:
run:
shell: bash -l {0}

name: ${{ matrix.label }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- 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: ${{ matrix.python-version }}

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

- uses: actions/cache@v2
with:
path: ${{ matrix.prefix }}
key: ${{ matrix.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: Lint with Black
run: |
# stop the build if there are problems
black --check --diff .

- name: Test activitysim.core
run: |
python -m pytest --pyargs activitysim.core

- name: Test activitysim.abm.models
run: |
python -m pytest --pyargs activitysim.abm.models

- name: Test activitysim.abm.test
run: |
python -m pytest --pyargs activitysim.abm.test

- name: Test activitysim.cli
run: |
python -m pytest --pyargs activitysim.cli


regional_models:
needs: foundation
env:
mamba-env-prefix: /usr/share/miniconda3/envs/asim-test
python-version: 3.9
label: linux-64
strategy:
matrix:
region:
- prototype_mtc
- prototype_arc
- placeholder_psrc
- prototype_marin
- prototype_mtc_extended
- placeholder_sandag
- prototype_sandag_xborder
- prototype_semcog
- placeholder_multiple_zone
fail-fast: false
defaults:
run:
shell: bash -l {0}
name: ${{ matrix.region }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- 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@v2
with:
path: ${{ env.mamba-env-prefix }}
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

# 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@v2
# # 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: |
python -m pytest activitysim/examples/${{ matrix.region }}/test --durations=0

estimation_mode:
needs: foundation
env:
mamba-env-prefix: /usr/share/miniconda3/envs/asim-test
python-version: 3.9
label: linux-64
defaults:
run:
shell: bash -l {0}
name: estimation_mode_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- 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@v2
with:
path: ${{ env.mamba-env-prefix }}
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 Larch
run: mamba install "larch>=5.5.3"

- 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 Estimation Mode
run: |
python -m pytest activitysim/estimation/test/test_larch_estimation.py --durations=0
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,7 @@ _test_est
*_local/
*_local.*

**/__sharrowcache__
**/output/
**/_generated_version.py
docs/users-guide/_generated
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
repos:

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

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
Loading