Skip to content

Commit

Permalink
Removed state variable from function call and added default empty arr…
Browse files Browse the repository at this point in the history
…ays for model settings
  • Loading branch information
JoeJimFlood committed Mar 28, 2024
1 parent b0061bc commit a3f6056
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions activitysim/abm/models/vehicle_type_choice.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ def iterate_vehicle_type_choice(
alts_preprocessor_settings = model_settings.alts_preprocessor
if alts_preprocessor_settings:
expressions.assign_columns(
state,
df=alts_wide,
model_settings=alts_preprocessor_settings,
locals_dict=locals_dict,
Expand Down Expand Up @@ -392,10 +391,10 @@ def iterate_vehicle_type_choice(
)

# filter columns of alts and choosers
if len(model_settings.get("COLS_TO_INCLUDE_IN_CHOOSER_TABLE")) > 0:
choosers = choosers[model_settings.get("COLS_TO_INCLUDE_IN_CHOOSER_TABLE")]
if len(model_settings.get("COLS_TO_INCLUDE_IN_ALTS_TABLE")) > 0:
alts_wide = alts_wide[model_settings.get("COLS_TO_INCLUDE_IN_ALTS_TABLE")]
if len(model_settings.get("COLS_TO_INCLUDE_IN_CHOOSER_TABLE", [])) > 0:
choosers = choosers[model_settings.get("COLS_TO_INCLUDE_IN_CHOOSER_TABLE", [])]
if len(model_settings.get("COLS_TO_INCLUDE_IN_ALTS_TABLE", [])) > 0:
alts_wide = alts_wide[model_settings.get("COLS_TO_INCLUDE_IN_ALTS_TABLE"l [])]

# if there were so many alts that they had to be created programmatically,
# by combining categorical variables, then the utility expressions should make
Expand Down

0 comments on commit a3f6056

Please sign in to comment.