From dde3d8bc6d14fa0f73e3a007a094c01c6c6023d7 Mon Sep 17 00:00:00 2001 From: David Hensle Date: Fri, 2 Feb 2024 17:17:00 -0800 Subject: [PATCH] logging and correct order for vehicle type name --- activitysim/abm/models/vehicle_type_choice.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/activitysim/abm/models/vehicle_type_choice.py b/activitysim/abm/models/vehicle_type_choice.py index 2c017b888d..a93399205d 100644 --- a/activitysim/abm/models/vehicle_type_choice.py +++ b/activitysim/abm/models/vehicle_type_choice.py @@ -244,12 +244,16 @@ def construct_model_alternatives( ), f"missing vehicle data for alternatives:\n {missing_alts}" else: # eliminate alternatives if no vehicle type data + num_alts_before_filer = len(alts_wide) alts_wide = alts_wide[alts_wide._merge != "left_only"] + logger.warning( + f"Removed {num_alts_before_filer - len(alts_wide)} alternatives not included in input vehicle type data." + ) # need to also remove any alts from alts_long - alts_long.set_index(["body_type", "fuel_type", "age"], inplace=True) + alts_long.set_index(["body_type", "age", "fuel_type"], inplace=True) alts_long = alts_long[ alts_long.index.isin( - alts_wide.set_index(["body_type", "fuel_type", "age"]).index + alts_wide.set_index(["body_type", "age", "fuel_type"]).index ) ].reset_index() alts_wide.drop(columns="_merge", inplace=True)