Closed i-am-sijia closed 8 months ago
The bug is in the trip_mode_choice_annotate_trips_preprocessors.csv.
There is this expression df.escort_participants.fillna('').apply(lambda x: len(x.split('_')))
that creates num_escortees
.
It is wrong and never results in 0 when the escort_participants
is missing or is an empty string. Because -
Changing the expression to df.escort_participants.fillna('').apply(lambda x: len(x.split('_')) if len(x)>0 else 0)
should fix this bug.
The fix was made to the https://github.com/ActivitySim/activitysim-prototype-mtc/commit/9ca05ca81a240cc74bfd764b1d859b55dbf597e0. The model was able to run through successfully. @jpn-- I did not change the version in this repo, given that we possibly want to discontinue hosting prototype_mtc in this repo.
Describe the bug The benchmarking run with full size MTC extended model crashed in trip mode choice in both Sharrow and non-Sharrow model, crashed in the same household, same trips.
Traced this household, it is crashed when trying to choose the trip modes for a school tour with 2 trips, the first trip is home-school and the second trip is school-home. The tour mode is DRIVEALONEFREE. Attaching relevant trip mode choice trace files.
trip_mode_choice_annotate_trips_preprocessor-fd6943.csv expression_values-fd6943.csv expression_value_DRIVEALONEFREE-fd6943.csv choosers-fd6943.csv raw_utilities-fd6943.csv
Two things seem odd:
num_escortees
is 1 and it made the DRIVEALONE mode unavailable. This variable is generated in the school escorting model.To Reproduce Steps to reproduce the behavior:
Expected behavior Trip mode choice should not crash