Skip to content

Commit ae7fa43

Browse files
authored
Merge pull request #636 from ActivitySim/develop
code for 1.2 release
2 parents 1e4ffc5 + 4bcad57 commit ae7fa43

File tree

520 files changed

+39242
-5041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

520 files changed

+39242
-5041
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build installer
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'Build installer for version (e.g. "1.0.4")'
7+
required: true
8+
type: string
9+
release:
10+
description: 'Upload as release artifact'
11+
required: true
12+
type: boolean
13+
14+
jobs:
15+
build:
16+
name: ActivitySim-${{ matrix.OS_NAME }}-${{ matrix.ARCH }}
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- os: windows-latest
23+
ARCH: x86_64
24+
TARGET_PLATFORM: win-64
25+
OS_NAME: "Windows"
26+
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v3
30+
31+
- uses: conda-incubator/setup-miniconda@35d1405e78aa3f784fe3ce9a2eb378d5eeb62169
32+
with:
33+
miniconda-version: "latest"
34+
if: contains(matrix.OS_NAME, 'Windows')
35+
36+
- name: Build installer
37+
env:
38+
ARCH: ${{ matrix.ARCH }}
39+
OS_NAME: ${{ matrix.OS_NAME }}
40+
TARGET_PLATFORM: ${{ matrix.TARGET_PLATFORM }}
41+
run: |
42+
export ACTIVITYSIM_VERSION=${{ inputs.version }}
43+
export EXT=exe
44+
source /c/Miniconda3/Scripts/activate;
45+
source other_resources/installer/build_win.sh;
46+
ls -alh build
47+
shell: bash
48+
49+
- name: Upload installer to Github artifact
50+
uses: actions/upload-artifact@v3
51+
with:
52+
path: build/Activitysim-${{ inputs.version }}-${{ matrix.OS_NAME }}-${{ matrix.ARCH }}*
53+
name: Activitysim-${{ inputs.version }}-${{ matrix.OS_NAME }}-${{ matrix.ARCH }}
54+
55+
- name: Upload installer to release
56+
uses: svenstaro/upload-release-action@v2
57+
with:
58+
repo_token: ${{ secrets.GITHUB_TOKEN }}
59+
file: build/Activitysim*
60+
tag: v${{ inputs.version }}
61+
overwrite: true
62+
file_glob: true
63+
if: inputs.release

.github/workflows/core_tests.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ jobs:
8181
run: |
8282
python -m pytest --pyargs activitysim.cli
8383
84+
8485
cross-platform:
8586
# also test foundation cross platforms, but do not require a successful
8687
# completion before starting regional model tests
@@ -162,6 +163,7 @@ jobs:
162163
run: |
163164
python -m pytest --pyargs activitysim.cli
164165
166+
165167
regional_models:
166168
needs: foundation
167169
env:
@@ -251,6 +253,59 @@ jobs:
251253
run: |
252254
python -m pytest activitysim/examples/${{ matrix.region }}/test --durations=0
253255
256+
random_seed_generation:
257+
needs: foundation
258+
env:
259+
mamba-env-prefix: /usr/share/miniconda3/envs/asim-test
260+
python-version: 3.9
261+
label: linux-64
262+
defaults:
263+
run:
264+
shell: bash -l {0}
265+
name: random_seed_generation_test
266+
runs-on: ubuntu-latest
267+
268+
steps:
269+
- uses: actions/checkout@v3
270+
271+
- name: Setup Mambaforge
272+
uses: conda-incubator/setup-miniconda@v2
273+
with:
274+
miniforge-variant: Mambaforge
275+
miniforge-version: latest
276+
activate-environment: asim-test
277+
use-mamba: true
278+
python-version: ${{ env.python-version }}
279+
280+
- name: Set cache date for year and month
281+
run: echo "DATE=$(date +'%Y%m')" >> $GITHUB_ENV
282+
283+
- uses: actions/cache@v2
284+
with:
285+
path: ${{ env.mamba-env-prefix }}
286+
key: ${{ env.label }}-conda-${{ hashFiles('conda-environments/github-actions-tests.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }}
287+
id: cache
288+
289+
- name: Update environment
290+
run: mamba env update -n asim-test -f conda-environments/github-actions-tests.yml
291+
if: steps.cache.outputs.cache-hit != 'true'
292+
293+
- name: Install activitysim
294+
# installing without dependencies is faster, we trust that all needed dependencies
295+
# are in the conda environment defined above. Also, this avoids pip getting
296+
# confused and reinstalling tables (pytables).
297+
run: |
298+
python -m pip install -e . --no-deps
299+
300+
- name: Conda checkup
301+
run: |
302+
mamba info -a
303+
mamba list
304+
305+
- name: Test Random Seed Generation
306+
run: |
307+
python -m pytest test/random_seed/test_random_seed.py --durations=0
308+
254309
estimation_mode:
255310
needs: foundation
256311
env:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ _test_est
7272
*_local/
7373
*_local.*
7474

75+
**/__sharrowcache__
76+
**/skims.zarr
7577
**/output/
7678
**/_generated_version.py
7779
docs/**/_generated

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
44
rev: v4.3.0
55
hooks:
6-
- id: check-yaml
7-
exclude: logging.yaml # TODO don't exclude, will require fixing logging
86
- id: end-of-file-fixer
97
exclude: .*\.ipynb
108
- id: trailing-whitespace

HOW_TO_RELEASE.md

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,17 @@
4040
and development. If they are not updated, these environments will end
4141
up with dependencies loaded from *pip* instead of *conda-forge*.
4242

43-
00. Run `black` to ensure that the codebase passes minimal style checks.
43+
00. Run black to ensure that the codebase passes all style checks.
4444
This check should only take a few seconds. These checks are also done on
45-
GitHub Actions and are platform independent, so they should not be necessary to
45+
Travis and are platform independent, so they should not be necessary to
4646
replicate locally, but are listed here for completeness.
4747
```sh
4848
black --check --diff .
4949
```
5050

51-
00. Run the regular test suite on Windows. Most GitHub Actions tests are done on Linux,
52-
Linux (it's faster to start up and run a new clean VM for testing) but most
53-
users are on Windows, and the test suite should also be run on Windows to
54-
ensure that it works on that platform as well. If you
51+
00. Run the regular test suite on Windows. Travis tests are done on Linux,
52+
but most users are on Windows, and the test suite should also be run
53+
on Windows to ensure that it works on that platform as well. If you
5554
are not preparing this release on Windows, you should be sure to run
5655
at least through this step on a Windows machine before finalizing a
5756
release.
@@ -67,7 +66,7 @@
6766
```
6867

6968
00. Test the full-scale regional examples. These examples are big, too
70-
large to run on GitHub Actions, and will take a lot of time (many hours) to
69+
large to run on Travis, and will take a lot of time (many hours) to
7170
download and run.
7271
```sh
7372
mkdir tmp-asim
@@ -88,6 +87,37 @@
8887
There are also demo notebooks for estimation, but their functionality
8988
is completely tested in the unit tests run previously.
9089
90+
00. Use bump2version to tag the release commit and update the
91+
version number. The following code will generate a "patch" release,
92+
incrementing the third value in the version number (i.e. "1.2.3"
93+
becomes "1.2.4"). Alternatively, make a "minor" or "major" release.
94+
The `--list` command will generate output to your console to confirm
95+
that the old and new version numbers are what you expect, before you
96+
push the commit (with the changed version in the code) and tags to
97+
GitHub.
98+
```sh
99+
bump2version patch --list
100+
```
101+
102+
It is also possible to make a development pre-release. To do so,
103+
explicitly set the version number to the next patch plus a ".devN"
104+
suffix:
105+
106+
```sh
107+
bump2version patch --new-version 1.2.3.dev0 --list
108+
```
109+
110+
Then, when ready to make a "final" release, set the version by
111+
explicitly removing the suffix:
112+
```sh
113+
bump2version patch --new-version 1.2.3 --list
114+
```
115+
116+
00. Push the tagged commit to GitHub.
117+
```sh
118+
git push --tags
119+
```
120+
91121
00. For non-development releases, open a pull request to merge the proposed
92122
release into main. The following command will open a web browser for
93123
you to create the pull request.
@@ -105,10 +135,6 @@
105135
```sh
106136
gh release create v1.2.3
107137
```
108-
The process of creating and tagging a release will automatically
109-
trigger various GitHub Actions scripts to build, test, and publish the
110-
new release to PyPI and conda forge, assuming there are no errors.
111-
112138
For a development pre-release, include the `--prerelease` argument.
113139
As the project's policy is that only formally released code is merged
114140
to the main branch, any pre-release should also be built against a
@@ -129,11 +155,3 @@
129155
conda deactivate
130156
conda env remove -n TEMP-ASIM-DEV
131157
```
132-
133-
00. Change the default redirect page for the ActivitySim documentation to point
134-
to the newly released documentation. The redirect page can be edited
135-
[here](https://github.com/ActivitySim/activitysim/blob/gh-pages/index.html).
136-
137-
00. Add the new release to the `switch.json` file. Don't delete the references
138-
for existing old documentation. The switcher can be edited
139-
[here](https://github.com/ActivitySim/activitysim/blob/gh-pages/switcher.json).

activitysim/abm/models/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# flake8: noqa
12
# ActivitySim
23
# See full license in LICENSE.txt.
4+
35
from . import (
46
accessibility,
57
atwork_subtour_destination,
@@ -8,6 +10,7 @@
810
atwork_subtour_scheduling,
911
auto_ownership,
1012
cdap,
13+
disaggregate_accessibility,
1114
free_parking,
1215
initialize,
1316
initialize_los,
@@ -24,11 +27,15 @@
2427
non_mandatory_scheduling,
2528
non_mandatory_tour_frequency,
2629
parking_location_choice,
30+
school_escorting,
2731
stop_frequency,
2832
summarize,
33+
telecommute_frequency,
2934
tour_mode_choice,
3035
tour_od_choice,
3136
tour_scheduling_probabilistic,
37+
transit_pass_ownership,
38+
transit_pass_subsidy,
3239
trip_departure_choice,
3340
trip_destination,
3441
trip_matrices,
@@ -39,4 +46,5 @@
3946
trip_scheduling_choice,
4047
vehicle_allocation,
4148
vehicle_type_choice,
49+
work_from_home,
4250
)

activitysim/abm/models/atwork_subtour_scheduling.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def atwork_subtour_scheduling(
4141
estimator = estimation.manager.begin_estimation("atwork_subtour_scheduling")
4242

4343
model_spec = simulate.read_model_spec(file_name=model_settings["SPEC"])
44+
sharrow_skip = model_settings.get("sharrow_skip")
4445
coefficients_df = simulate.read_model_coefficients(model_settings)
4546
model_spec = simulate.eval_coefficients(model_spec, coefficients_df, estimator)
4647

@@ -79,6 +80,7 @@ def atwork_subtour_scheduling(
7980
estimator=estimator,
8081
chunk_size=chunk_size,
8182
trace_label=trace_label,
83+
sharrow_skip=sharrow_skip,
8284
)
8385

8486
if estimator:

0 commit comments

Comments
 (0)