activitysim icon indicating copy to clipboard operation
activitysim copied to clipboard

Preprocessing & Annotation functionality

Open dhensle opened this issue 5 months ago • 3 comments

This pull request standardizes preprocessing and annotation capabilities across all activitysim abm models.

Refactoring of Preprocessing and Table Annotation

  • Standardized Preprocessing:

    • Replaced custom preprocessing logic using expressions.assign_columns with expressions.annotate_preprocessors in models such as auto_ownership, free_parking, and joint_tour_composition. This change ensures consistency across models and reduces duplication. [1] [2] [3]
  • Unified Table Annotation:

    • Replaced individual table annotation logic with expressions.annotate_tables in models like atwork_subtour_destination, cdap, and joint_tour_frequency. This provides a consistent and reusable approach for post-model table updates. [1] [2] [3]

Simplification of Model Settings

  • Removal of Unused Fields:

    • Removed unnecessary fields like preprocessor and annotate_* from model settings classes such as AtworkSubtourFrequencySettings, AutoOwnershipSettings, and FreeParkingSettings. This cleanup eliminates unused or redundant configuration options. [1] [2] [3]
  • Reorganization in cdap:

    • Consolidated preprocessor and annotation settings into a single unified structure for better clarity and alignment with other models.

Summary table of model changes:

Model name Choosers Preprocessor Alts Preprocessor Annotator Notes
accessibility existed N/A N/A model is essentially a preprocessor
atwork_subtour_destination added added added added preprocessing in both sample and simulate step in util.tour_destination.py
atwork_subtour_frequency updated N/A added  
atwork_subtour_mode_choice updated N/A added  
atwork_subtour_scheduling added existed added ALTS_PREPROCESSOR segmented by tour purpose, added in util.vectorize_tour_scheduling.py
auto_ownership updated N/A added  
cdap added N/A updated  
disaggregate_accessibility existed N/A existed now can use alts preprocessors in logsum calculations through tour and location choice models
free_parking updated N/A updated  
initialize N/A N/A updated Model is annotator
initialize_los N/A N/A N/A  
initialize_tours N/A N/A updated Model is annotator
input_checker N/A N/A N/A  
joint_tour_composition updated N/A updated  
joint_tour_destination added added added added preprocessing in both sample and simulate step in util.tour_destination.py
joint_tour_frequency updated N/A added  
joint_tour_frequency_composition updated updated updated  
joint_tour_participation updated N/A added  
joint_tour_scheduling updated added updated ALTS_PREPROCESSOR segmented by tour purpose, added in util.vectorize_tour_scheduling.py
location_choice added added updated added preprocessing in both sample and simulate step
mandatory_scheduling added existed added ALTS_PREPROCESSOR segmented by tour purpose, added in util.vectorize_tour_scheduling.py
mandatory_tour_frequency updated N/A added  
non_mandatory_destination added added added added preprocessing in both sample and simulate step in util.tour_destination.py
non_mandatory_scheduling added added added ALTS_PREPROCESSOR segmented by tour purpose, added in util.vectorize_tour_scheduling.py
non_mandatory_tour_frequency updated added added  
parking_location_choice updated added added  
school_escorting existed added added uniquely has 3 preprocessors
stop_frequency updated N/A added  
summarize N/A N/A existed Model is annotator
telecommute_frequency updated N/A added  
tour_mode_choice updated N/A added  
tour_od_choice updated added added added preprocessing in both sample and simulate step
tour_scheduling_probabilistic N/A N/A added  
transit_pass_ownership updated N/A added  
transit_pass_subsidy updated N/A added  
trip_departure_choice existed added added  
trip_destination updated updated added added preprocessing in both sample and simulate step
trip_matrices existed N/A N/A  
trip_mode_choice existed N/A updated  
trip_purpose updated N/A added  
trip_purpose_and_destination N/A N/A added  
trip_scheduling updated N/A added is probabilistic model
trip_scheduling_choice updated added added  
vehicle_allocation updated N/A added  
vehicle_type_choice updated updated updated  
work_from_home updated N/A updated  

dhensle avatar Jun 17 '25 16:06 dhensle