Skip to content

Commit

Permalink
Merge pull request #1 from SANDAG/BayDAG
Browse files Browse the repository at this point in the history
Create BayDAG branch in sync with SANDAG's BayDAG branch
  • Loading branch information
lmz authored Aug 5, 2022
2 parents 3df695b + 452b841 commit 6c1fc02
Show file tree
Hide file tree
Showing 135 changed files with 11,978 additions and 303 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,4 @@ _test_est
*_local/
*_local.*

**/output/
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
- stage: Examples
name: "MTC Example"
env: TEST_SUITE=activitysim/examples/example_mtc/test
- name: "MTC Extended Example"
env: TEST_SUITE=activitysim/examples/example_mtc_extended/test
- name: "Multizone Example"
env: TEST_SUITE=activitysim/examples/example_multiple_zone/test
- name: "Marin Example"
Expand Down
4 changes: 2 additions & 2 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
BSD 3-Clause License

Copyright (c) After March 2016, Contributing Authors
Copyright (c) Before March 2016, UrbanSim Inc
Copyright (c) Association of Metropolitan Planning Organizations Research Foundation

All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ActivitySim
===========

[![Build Status](https://travis-ci.org/ActivitySim/activitysim.svg?branch=master)](https://travis-ci.org/ActivitySim/activitysim)[![Coverage Status](https://coveralls.io/repos/github/ActivitySim/activitysim/badge.svg?branch=master)](https://coveralls.io/github/ActivitySim/activitysim?branch=master)
[![Build Status](https://travis-ci.com/ActivitySim/activitysim.svg?branch=master)](https://travis-ci.org/github/ActivitySim/activitysim)[![Coverage Status](https://coveralls.io/repos/github/ActivitySim/activitysim/badge.svg?branch=master)](https://coveralls.io/github/ActivitySim/activitysim?branch=master)

The mission of the ActivitySim project is to create and maintain advanced, open-source,
activity-based travel behavior modeling software based on best software development
Expand All @@ -15,4 +15,4 @@ and benefit from contributions of other agency partners.

## Documentation

https://activitysim.github.io/activitysim
https://activitysim.github.io/activitysim
2 changes: 2 additions & 0 deletions activitysim/abm/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@
from . import trip_scheduling_choice
from . import trip_matrices
from . import summarize
from . import vehicle_allocation
from . import vehicle_type_choice
3 changes: 3 additions & 0 deletions activitysim/abm/models/accessibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def compute_accessibilities_for_zones(
trace_od_rows = None

# merge land_use_columns into od_df
logger.info(f"{trace_label}: merge land_use_columns into od_df")
od_df = pd.merge(od_df, land_use_df, left_on='dest', right_index=True).sort_index()
chunk.log_df(trace_label, "od_df", od_df)

Expand All @@ -69,11 +70,13 @@ def compute_accessibilities_for_zones(
if network_los.zone_system == los.THREE_ZONE:
locals_d['tvpb'] = network_los.tvpb

logger.info(f"{trace_label}: assign.assign_variables")
results, trace_results, trace_assigned_locals \
= assign.assign_variables(assignment_spec, od_df, locals_d,
trace_rows=trace_od_rows, trace_label=trace_label, chunk_log=True)

chunk.log_df(trace_label, "results", results)
logger.info(f"{trace_label}: have results")

# accessibility_df = accessibility_df.copy()
for column in results.columns:
Expand Down
10 changes: 10 additions & 0 deletions activitysim/abm/models/atwork_subtour_mode_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from activitysim.core import inject
from activitysim.core import pipeline
from activitysim.core import simulate
from activitysim.core import expressions

from activitysim.core import los
from activitysim.core.pathbuilder import TransitVirtualPathBuilder
Expand Down Expand Up @@ -166,6 +167,15 @@ def atwork_subtour_mode_choice(
assign_in_place(tours, choices_df)
pipeline.replace_table("tours", tours)

# - annotate tours table
if model_settings.get('annotate_tours'):
tours = inject.get_table('tours').to_frame()
expressions.assign_columns(
df=tours,
model_settings=model_settings.get('annotate_tours'),
trace_label=tracing.extend_trace_label(trace_label, 'annotate_tours'))
pipeline.replace_table("tours", tours)

if trace_hh_id:
tracing.trace_df(tours[tours.tour_category == 'atwork'],
label=tracing.extend_trace_label(trace_label, mode_column_name),
Expand Down
12 changes: 6 additions & 6 deletions activitysim/abm/models/initialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ def preload_injectables():

t0 = tracing.print_elapsed_time()

# FIXME - still want to do this?
# if inject.get_injectable('skim_dict', None) is not None:
# t0 = tracing.print_elapsed_time("preload skim_dict", t0, debug=True)
#
# if inject.get_injectable('skim_stack', None) is not None:
# t0 = tracing.print_elapsed_time("preload skim_stack", t0, debug=True)
if config.setting('benchmarking', False):
# we don't want to pay for skim_dict inside any model component during
# benchmarking, so we'll preload skim_dict here. Preloading is not needed
# for regular operation, as activitysim components can load-on-demand.
if inject.get_injectable('skim_dict', None) is not None:
t0 = tracing.print_elapsed_time("preload skim_dict", t0, debug=True)

return True
8 changes: 8 additions & 0 deletions activitysim/abm/models/location_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,10 @@ def workplace_location(
# if multiprocessing.current_process().name =='mp_households_0':
# raise RuntimeError(f"fake fail {process_name}")

# disable locutor for benchmarking
if config.setting('benchmarking', False):
locutor = False

iterate_location_choice(
model_settings,
persons_merged, persons, households,
Expand Down Expand Up @@ -917,6 +921,10 @@ def school_location(
if estimator:
write_estimation_specs(estimator, model_settings, 'school_location.yaml')

# disable locutor for benchmarking
if config.setting('benchmarking', False):
locutor = False

iterate_location_choice(
model_settings,
persons_merged, persons, households,
Expand Down
Loading

0 comments on commit 6c1fc02

Please sign in to comment.