From 4470dd4d8fc7f289183e7b0e8654694934519ae7 Mon Sep 17 00:00:00 2001 From: David Hensle Date: Mon, 11 Mar 2024 14:10:42 -0700 Subject: [PATCH] updating to work with Pydantic and State object --- activitysim/abm/models/school_escorting.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/activitysim/abm/models/school_escorting.py b/activitysim/abm/models/school_escorting.py index 7151ba34b..a1f7de712 100644 --- a/activitysim/abm/models/school_escorting.py +++ b/activitysim/abm/models/school_escorting.py @@ -466,8 +466,8 @@ def school_escorting( # FIXME setting index as "Alt" causes crash in estimation mode... # happens in joint_tour_frequency_composition too! - # alts = simulate.read_model_alts(state, model_settings["ALTS"], set_index="Alt") - alts = simulate.read_model_alts(state, model_settings["ALTS"], set_index=None) + # alts = simulate.read_model_alts(state, model_settings.ALTS, set_index="Alt") + alts = simulate.read_model_alts(state, model_settings.ALTS, set_index=None) alts.index = alts["Alt"].values choosers, participant_columns = determine_escorting_participants( @@ -491,8 +491,8 @@ def school_escorting( bundle_name="school_escorting", ) - model_spec_raw = simulate.read_model_spec( - file_name=model_settings[stage.upper() + "_SPEC"] + model_spec_raw = state.filesystem.read_model_spec( + file_name=getattr(model_settings, stage.upper() + "_SPEC") ) model_spec_raw = state.filesystem.read_model_spec( @@ -633,7 +633,7 @@ def school_escorting( ) school_escort_tours = school_escort_tours_trips.create_pure_school_escort_tours( - escort_bundles + state, escort_bundles ) chauf_tour_id_map = { v: k for k, v in school_escort_tours["bundle_id"].to_dict().items() @@ -652,9 +652,8 @@ def school_escorting( tours, school_escort_tours ) tours = school_escort_tours_trips.process_tours_after_escorting_model( - escort_bundles, tours + state, escort_bundles, tours ) - school_escort_trips = school_escort_tours_trips.create_school_escort_trips( escort_bundles )