Skip to content

Commit d60cab6

Browse files
committed
Squashed commit of the following:
commit c031c8b Author: David Hensle <hensle93@gmail.com> Date: Fri Feb 13 15:48:35 2026 -0800 adding ignore list to skim load for unused skims commit 83613b2 Author: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu Feb 12 16:30:58 2026 -0600 Fix Sphinx currentmodule directive for location choice documentation (ActivitySim#1034) * Initial plan * Fix currentmodule directive in work_location_choice.md and school_location_choice.md Co-authored-by: jpn-- <1036626+jpn--@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jpn-- <1036626+jpn--@users.noreply.github.com> commit aa58cc4 Author: David Hensle <51132108+dhensle@users.noreply.github.com> Date: Fri Jan 16 03:31:07 2026 +1100 Fix for zones reopening in simulation-based constraint mechanism for work/school location choice (ActivitySim#1028) * addresses issue with zones reopening after being closed in shadow_pricing * addresses issue with zones reopening after being closed in shadow_pricing * adding shadow price regression values * updating change log --------- Co-authored-by: juangacosta <juan.acosta@rsginc.com> commit 6266ce4 Author: David Hensle <51132108+dhensle@users.noreply.github.com> Date: Thu Jan 8 10:26:48 2026 -0800 Index names consistently set to "alt" for alternatives files (ActivitySim#1018) * "alt" now used as index in all alternatives modules * formatting * minor commenting * using stable sorting for unit test * adding to change log * updating school escort bundle Alt to alt * typo * Revert "updating school escort bundle Alt to alt" This reverts commit 625f685. * regenerate pipeline --------- Co-authored-by: juangacosta <juan.acosta@rsginc.com> Co-authored-by: Jeffrey Newman <jeff@driftless.xyz> commit 0811191 Author: Jeffrey Newman <jeff@driftless.xyz> Date: Thu Jan 8 11:11:43 2026 -0600 Repair CDAP estimation (ActivitySim#1026) * fix error in CDAP estimation model construction * update tests for CDAP * fix the other test file * add to changes.md * note on possible fixes
1 parent 623cec5 commit d60cab6

File tree

15 files changed

+15330
-2742
lines changed

15 files changed

+15330
-2742
lines changed

activitysim/abm/models/joint_tour_frequency_composition.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,9 @@ def joint_tour_frequency_composition(
4444
model_settings_file_name,
4545
)
4646

47-
# FIXME setting index as "alt" causes crash in estimation mode...
4847
alts = simulate.read_model_alts(
49-
state, "joint_tour_frequency_composition_alternatives.csv", set_index=None
48+
state, "joint_tour_frequency_composition_alternatives.csv", set_index="alt"
5049
)
51-
alts.index = alts["alt"].values
5250

5351
# - only interested in households with more than one cdap travel_active person and
5452
# - at least one non-preschooler

activitysim/abm/models/school_escorting.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def create_school_escorting_bundles_table(choosers, tours, stage):
308308
bundles["chauf_id"],
309309
)
310310

311-
bundles["Alt"] = choosers["Alt"]
311+
bundles["alt"] = choosers["alt"]
312312
bundles["Description"] = choosers["Description"]
313313

314314
return bundles
@@ -412,11 +412,7 @@ def school_escorting(
412412

413413
trace_hh_id = state.settings.trace_hh_id
414414

415-
# FIXME setting index as "Alt" causes crash in estimation mode...
416-
# happens in joint_tour_frequency_composition too!
417-
# alts = simulate.read_model_alts(state, model_settings.ALTS, set_index="Alt")
418-
alts = simulate.read_model_alts(state, model_settings.ALTS, set_index=None)
419-
alts.index = alts["Alt"].values
415+
alts = simulate.read_model_alts(state, model_settings.ALTS, set_index="alt")
420416

421417
choosers, participant_columns = determine_escorting_participants(
422418
households_merged, persons, model_settings
@@ -565,10 +561,10 @@ def school_escorting(
565561
)
566562

567563
if stage_num >= 1:
568-
choosers["Alt"] = choices
569-
choosers = choosers.join(alts.set_index("Alt"), how="left", on="Alt")
564+
choosers["alt"] = choices
565+
choosers = choosers.join(alts, how="left", on="alt")
570566
bundles = create_school_escorting_bundles_table(
571-
choosers[choosers["Alt"] > 1], tours, stage
567+
choosers[choosers["alt"] > 1], tours, stage
572568
)
573569
escort_bundles.append(bundles)
574570

activitysim/abm/tables/shadow_pricing.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,10 +860,20 @@ def update_shadow_prices(self, state):
860860
sprice.replace([np.inf, -np.inf], 0, inplace=True)
861861

862862
# shadow prices are set to -999 if overassigned or 0 if the zone still has room for this segment
863-
self.shadow_prices[segment] = np.where(
863+
old_shadow_prices = self.shadow_prices[segment].values
864+
new_shadow_prices = np.where(
864865
(sprice <= 1 + percent_tolerance / 100), -999, 0
865866
)
866867

868+
# the conditions above allow for zones to be reopened, but we want to prevent such behavior
869+
new_shadow_prices = np.where(
870+
(old_shadow_prices == -999) & (new_shadow_prices != -999),
871+
old_shadow_prices,
872+
new_shadow_prices,
873+
)
874+
875+
self.shadow_prices[segment] = new_shadow_prices
876+
867877
zonal_sample_rate = 1 - sprice
868878
overpredicted_zones = self.shadow_prices[
869879
self.shadow_prices[segment] == -999

0 commit comments

Comments
 (0)