Depot deadhead trips#30
Conversation
dan-mccabe
left a comment
There was a problem hiding this comment.
test_depot_deadhead.ipynb seemed like it was just used in initial development and quickly raises an error on my machine due to a missing data file, so I removed it rather than merging it into main.
dan-mccabe
left a comment
There was a problem hiding this comment.
Hi Yi, thanks for putting this together. I made a few quick commits to fix some issues and left some comments about code revisions in generate_deadhead_traces.py. Handing this back to you for now -- could you please make the following updates?
-
Resolve the
mypyerrors (related to variable type hint consistency) that are currently causing CI errors on this pull request. In the future please verify that these checks pass and resolve any issues as much as you can. All those checks are really doing now is looking at formatting/linting and type consistency, since we haven't really populated tests yet. -
Make some updates in
generate_deadhead_traces.pybased on the comments I left.
I have some more thoughts about how we might update and speed up this code but I'll save those for after these initial fixes (I need a little more time to dig into your code as well). Thanks again.
e4da2aa to
5b22e23
Compare
Added a second output to the build_routee_features_with_osm function, which stores HVAC and BTMS energy consumption for each trip_id. Updated energy calculations to include HVAC energy for winter and summer.
Updated the logic to select the best depot per block based on minimizing total pull-out and pull-in distances.
Updated vehicle model to 'Transit_Bus_Battery_Electric' and integrated HVAC energy calculations into trip energy predictions.
|
@YiZoeHe There are some references to undefined functions in here. I think they might be referencing the old names of functions that were renamed? Please take a look at it when you get the chance to get the script working again. % pixi run -e dev-py311 python scripts/single_agency_full_analysis.py
2025-11-06 13:54:28,956 [INFO] gtfs_feature_processing - Feed includes trips for the following agencies: ['Utah Transit Authority']. There are 12037 trips and 238 shapes
2025-11-06 13:54:28,973 [INFO] gtfs_feature_processing - Restricted feed to 56 trips and 2 shapes
Traceback (most recent call last):
File "/Users/dmccabe/repos/public/routee-transit/scripts/single_agency_full_analysis.py", line 73, in <module>
routee_input_df, trips_df, feed = build_routee_features_with_osm(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/dmccabe/repos/public/routee-transit/nrel/routee/transit/prediction/gtfs_feature_processing.py", line 481, in build_routee_features_with_osm
betweenTrip_deadhead_trips_df = create_betweenTrip_deadhead_trips(trips_df,stop_times_df)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
NameError: name 'create_betweenTrip_deadhead_trips' is not defined. Did you mean: 'betweenTrip_deadhead_trips_df'? |
…head routing works consistently
…s in create_depot_deadhead_trips()
|
@YiZoeHe I went ahead and fixed the issues I mentioned in last comment, plus a few other things that came up when I tried getting the whole pipeline to run. Things seem to be working as intended now, so I'm going to merge and close this PR. |
Added energy consumption prediction for deadhead trips from and to bus depot for each block id.