Skip to content

Commit d96c740

Browse files
authored
Merge branch 'mtc_tm2' into ft_vis_1
2 parents 3974e39 + 15235e8 commit d96c740

28 files changed

+2877439
-5054
lines changed

.dockerignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**/__pycache__
2+
**/.classpath
3+
**/.dockerignore
4+
**/.env
5+
**/.git
6+
**/.gitignore
7+
**/.project
8+
**/.settings
9+
**/.toolstarget
10+
**/.vs
11+
**/.vscode
12+
**/*.*proj.user
13+
**/*.dbmdl
14+
**/*.jfm
15+
**/bin
16+
**/charts
17+
**/docker-compose*
18+
**/compose*
19+
**/Dockerfile*
20+
**/node_modules
21+
**/npm-debug.log
22+
**/obj
23+
**/secrets.dev.yaml
24+
**/values.dev.yaml
25+
README.md

.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Remote Attach",
9+
"type": "python",
10+
"request": "attach",
11+
"connect": {
12+
"host": "localhost",
13+
"port": 5678
14+
},
15+
"pathMappings": [
16+
{
17+
"localRoot": "${workspaceFolder}",
18+
"remoteRoot": "."
19+
}
20+
]
21+
}
22+
]
23+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import logging
2+
import pytest
3+
import os
4+
import pandas as pd
5+
6+
# import models is necessary to initalize the model steps with orca
7+
from activitysim.abm import models
8+
from activitysim.core import pipeline, config
9+
10+
11+
# Used by conftest.py initialize_pipeline method
12+
@pytest.fixture(scope='module')
13+
def module() -> str:
14+
"""
15+
A pytest fixture that returns the data folder location.
16+
:return: folder location for any necessary data to initialize the tests
17+
"""
18+
return 'auto_ownership'
19+
20+
21+
# Used by conftest.py initialize_pipeline method
22+
@pytest.fixture(scope='module')
23+
def tables() -> dict[str, str]:
24+
"""
25+
A pytest fixture that returns the "mock" tables to build pipeline dataframes. The
26+
key-value pair is the name of the table and the index column.
27+
:return: dict
28+
"""
29+
return {
30+
'land_use': 'zone_id',
31+
'persons': 'person_id',
32+
'households': 'household_id',
33+
}
34+
35+
36+
# Used by conftest.py initialize_pipeline method
37+
# Set to true if you need to read skims into the pipeline
38+
@pytest.fixture(scope='module')
39+
def initialize_network_los() -> bool:
40+
"""
41+
A pytest boolean fixture indicating whether network skims should be read from the
42+
fixtures test data folder.
43+
:return: bool
44+
"""
45+
return False
46+
47+
48+
def test_auto_ownership(initialize_pipeline: pipeline.Pipeline, caplog):
49+
# Run summarize model
50+
caplog.set_level(logging.DEBUG)
51+
pipeline.run(models=['auto_ownership_simulate'])
52+
53+
# # Retrieve output tables to check contents
54+
# model_settings = config.read_model_settings('auto_ownership.yaml')
55+
# output_location = (model_settings['OUTPUT'] if 'OUTPUT' in model_settings else 'output')
56+
# output_dir = config.output_file_path(output_location)
57+
58+
# # Check that households are counted correctly
59+
# households_count = pd.read_csv(config.output_file_path(os.path.join(output_location, f'households_count.csv')))
60+
# households = pd.read_csv(config.data_file_path("households.csv"))
61+
# assert int(households_count.iloc[0]) == len(households)
62+
63+
# # Check that bike trips are counted correctly
64+
# trips_by_mode_count = pd.read_csv(
65+
# config.output_file_path(os.path.join(output_location, f'trips_by_mode_count.csv')))
66+
# trips = pd.read_csv(config.data_file_path("trips.csv"))
67+
# assert int(trips_by_mode_count.BIKE.iloc[0]) == len(trips[trips.trip_mode == 'BIKE'])
3.5 MB
Binary file not shown.

activitysim/examples/example_mtc/configs/summarize.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,3 @@ Description,Output,Expression
113113

114114

115115

116-

activitysim/examples/example_mtc/configs_mp/settings.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,26 @@ inherit_settings: True
55
fail_fast: True
66

77
# - ------------------------- production config
8-
#multiprocess: True
9-
#strict: False
10-
#use_shadow_pricing: True
8+
multiprocess: True
9+
strict: False
10+
use_shadow_pricing: True
1111

1212
# - full sample - 2875192 households on 64 processor 432 GiB RAM
13-
#households_sample_size: 0
14-
#chunk_size: 400_000_000_000
15-
#num_processes: 60
13+
households_sample_size: 100
14+
chunk_size: 30_000_000_000
15+
num_processes: 8
1616

1717
# - ------------------------- no chunking due to sufficient RAM
18-
# chunk_training_mode: disabled
18+
chunk_training_mode: production
1919

2020
# - ------------------------- dev config
21-
multiprocess: True
22-
strict: False
23-
use_shadow_pricing: False
21+
# multiprocess: True
22+
# strict: False
23+
# use_shadow_pricing: False
2424

25-
households_sample_size: 0
26-
chunk_size: 0
27-
num_processes: 2
25+
# households_sample_size: 100
26+
# chunk_size: 0
27+
# num_processes: 2
2828

2929
# - -------------------------
3030

@@ -39,7 +39,7 @@ want_dest_choice_sample_tables: False
3939
trace_od:
4040

4141
# to resume after last successful checkpoint, specify resume_after: _
42-
#resume_after: trip_purpose_and_destination
42+
resume_after: write_tables
4343

4444
models:
4545
### mp_initialize step

activitysim/examples/example_mtc/data/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)