Skip to content

Commit 90c8290

Browse files
authored
Remove Three Zone Code and Examples (#1056)
* removing tvpb from models * remove core 3-zone code * removing tests and examples * blacken * remove pathbuilder import calls * remove references to initialize_los * removing sandag 3 zone and doc references * fix skim name conflict test * fixing failed choice test
1 parent 4df74d0 commit 90c8290

347 files changed

Lines changed: 69 additions & 1486747 deletions

File tree

Some content is hidden

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

.github/workflows/core_tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,7 @@ jobs:
143143
region:
144144
- prototype_mtc
145145
- placeholder_psrc
146-
- prototype_marin
147146
- prototype_mtc_extended
148-
- prototype_sandag_xborder
149147
- production_semcog
150148
- prototype_mwcog
151149
- placeholder_multiple_zone

activitysim/abm/models/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
disaggregate_accessibility,
1414
free_parking,
1515
initialize,
16-
initialize_los,
1716
initialize_tours,
1817
input_checker,
1918
joint_tour_composition,

activitysim/abm/models/accessibility.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,6 @@ def compute_accessibilities_for_zones(
154154
locals_d["skim_od"] = skim_dict.wrap("orig", "dest").set_df(od_df)
155155
locals_d["skim_do"] = skim_dict.wrap("dest", "orig").set_df(od_df)
156156

157-
if network_los.zone_system == los.THREE_ZONE:
158-
locals_d["tvpb"] = network_los.tvpb
159-
160157
logger.info(f"{trace_label}: assign.assign_variables")
161158
results, trace_results, trace_assigned_locals = assign.assign_variables(
162159
state,

activitysim/abm/models/atwork_subtour_mode_choice.py

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -97,38 +97,6 @@ def atwork_subtour_mode_choice(
9797
"in_time_col_name": in_time_col_name,
9898
}
9999

100-
if network_los.zone_system == los.THREE_ZONE:
101-
# fixme - is this a lightweight object?
102-
tvpb = network_los.tvpb
103-
104-
tvpb_logsum_odt = tvpb.wrap_logsum(
105-
orig_key=orig_col_name,
106-
dest_key=dest_col_name,
107-
tod_key="out_period",
108-
segment_key="demographic_segment",
109-
cache_choices=True,
110-
trace_label=trace_label,
111-
tag="tvpb_logsum_odt",
112-
)
113-
tvpb_logsum_dot = tvpb.wrap_logsum(
114-
orig_key=dest_col_name,
115-
dest_key=orig_col_name,
116-
tod_key="in_period",
117-
segment_key="demographic_segment",
118-
cache_choices=True,
119-
trace_label=trace_label,
120-
tag="tvpb_logsum_dot",
121-
)
122-
123-
skims.update(
124-
{"tvpb_logsum_odt": tvpb_logsum_odt, "tvpb_logsum_dot": tvpb_logsum_dot}
125-
)
126-
127-
# TVPB constants can appear in expressions
128-
constants.update(
129-
network_los.setting("TVPB_SETTINGS.tour_mode_choice.CONSTANTS")
130-
)
131-
132100
estimator = estimation.manager.begin_estimation(state, "atwork_subtour_mode_choice")
133101
if estimator:
134102
estimator.write_coefficients(model_settings=model_settings)
@@ -152,32 +120,6 @@ def atwork_subtour_mode_choice(
152120
trace_choice_name="tour_mode_choice",
153121
)
154122

155-
# add cached tvpb_logsum tap choices for modes specified in tvpb_mode_path_types
156-
if network_los.zone_system == los.THREE_ZONE:
157-
tvpb_mode_path_types = model_settings.tvpb_mode_path_types
158-
for mode, path_types in tvpb_mode_path_types.items():
159-
for direction, skim in zip(
160-
["od", "do"], [tvpb_logsum_odt, tvpb_logsum_dot]
161-
):
162-
path_type = path_types[direction]
163-
skim_cache = skim.cache[path_type]
164-
165-
print(f"mode {mode} direction {direction} path_type {path_type}")
166-
167-
for c in skim_cache:
168-
dest_col = f"{direction}_{c}"
169-
170-
if dest_col not in choices_df:
171-
choices_df[dest_col] = (
172-
np.nan
173-
if pd.api.types.is_numeric_dtype(skim_cache[c])
174-
else ""
175-
)
176-
177-
choices_df[dest_col].where(
178-
choices_df.tour_mode != mode, skim_cache[c], inplace=True
179-
)
180-
181123
if estimator:
182124
estimator.write_choices(choices_df[mode_column_name])
183125
choices_df[mode_column_name] = estimator.get_survey_values(

activitysim/abm/models/initialize_los.py

Lines changed: 0 additions & 287 deletions
This file was deleted.

0 commit comments

Comments
 (0)