Remove SIMULATE_CHOOSER_COLUMNS memory hacks and expose global constants in utility expressions#1075
Closed
asiripanich wants to merge 1 commit intoActivitySim:mainfrom
Closed
Conversation
Manual chooser-column filtering (SIMULATE/LOGSUM_CHOOSER_COLUMNS) was a memory workaround that is now redundant: drop_unused_columns in ComputeSettings (default True) prunes DataFrame columns automatically one layer beneath each model function. Remove all the FIXME blocks and the household_id patch-ups they contained. Deprecate SIMULATE_CHOOSER_COLUMNS and LOGSUM_CHOOSER_COLUMNS in all settings classes so existing YAML configs emit DeprecationWarning instead of failing. Also wire state.get_global_constants() into locals_d at every utility- evaluation site (_location_sample, run_location_simulate, _destination_sample, run_destination_simulate, _od_sample, run_od_simulate, _schedule_tours) so global constants are available in @ expressions in CSV specs. Closes ActivitySim#1017 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
|
Whoops! wrong git remote! apologies :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SIMULATE_CHOOSER_COLUMNS/LOGSUM_CHOOSER_COLUMNSmemory hacks): allFIXME - MEMORY HACKblocks andhousehold_idpatch-ups are deleted fromlocation_choice.py,tour_destination.py,tour_od.py,tour_scheduling.py, andschool_escorting.py. Memory pruning is now handled automatically byComputeSettings.drop_unused_columns(defaultTrue) insideinteraction_sample/interaction_sample_simulate.SIMULATE_CHOOSER_COLUMNSandLOGSUM_CHOOSER_COLUMNSin all settings classes (TourLocationComponentSettings,TourModeComponentSettings,SchoolEscortSettings,TourSchedulingSettings) — existing YAML configs emit aDeprecationWarninginstead of failing.state.get_global_constants()is now injected intolocals_dat every utility-evaluation site (_location_sample,run_location_simulate,_destination_sample,run_destination_simulate,_od_sample,run_od_simulate,_schedule_tours) so global constants are available in@-prefixed CSV spec expressions.Closes #1017
Test plan
uv run pytest activitysim/core/test activitysim/abm/test activitysim/abm/models/util/test— 103 passed, 0 faileduv run black --check .— no formatting issuesuv run ruff check .— no new errors in changed filesgrep -rn "filter_chooser_columns" activitysim/returns zero resultsgrep -rn "Drop this when PR #1017" activitysim/returns zero results🤖 Generated with Claude Code