From ccd04772ed0dbaf4934527e15f1b9a7a72bb0bc1 Mon Sep 17 00:00:00 2001 From: David Hensle <51132108+dhensle@users.noreply.github.com> Date: Wed, 24 Apr 2024 16:52:28 -0700 Subject: [PATCH] allow skims in trip mode choice annotate (#857) --- activitysim/abm/models/trip_mode_choice.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/activitysim/abm/models/trip_mode_choice.py b/activitysim/abm/models/trip_mode_choice.py index e3e530fb7..b3dd0e7f4 100644 --- a/activitysim/abm/models/trip_mode_choice.py +++ b/activitysim/abm/models/trip_mode_choice.py @@ -371,6 +371,12 @@ def trip_mode_choice( state.add_table("trips", trips_df) if model_settings.annotate_trips: + # need to update locals_dict to access skims that are the same .shape as trips table + locals_dict = {} + locals_dict.update(constants) + simulate.set_skim_wrapper_targets(trips_merged, skims) + locals_dict.update(skims) + locals_dict["timeframe"] = "trip" annotate.annotate_trips(state, model_settings, trace_label, locals_dict) if state.settings.trace_hh_id: