Skip to content

Depot deadhead trips#30

Merged
dan-mccabe merged 29 commits intomainfrom
deadhead_depot
Nov 7, 2025
Merged

Depot deadhead trips#30
dan-mccabe merged 29 commits intomainfrom
deadhead_depot

Conversation

@YiZoeHe
Copy link
Copy Markdown
Collaborator

@YiZoeHe YiZoeHe commented Oct 9, 2025

Added energy consumption prediction for deadhead trips from and to bus depot for each block id.

@dan-mccabe dan-mccabe self-assigned this Oct 13, 2025
Copy link
Copy Markdown
Collaborator

@dan-mccabe dan-mccabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

@dan-mccabe dan-mccabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 mypy errors (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.py based 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.

Comment thread nrel/routee/transit/prediction/generate_deadhead_traces.py Outdated
Comment thread nrel/routee/transit/prediction/generate_deadhead_traces.py Outdated
Comment thread nrel/routee/transit/prediction/generate_deadhead_traces.py Outdated
@YiZoeHe YiZoeHe force-pushed the deadhead_depot branch 2 times, most recently from e4da2aa to 5b22e23 Compare October 22, 2025 17:34
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.
@dan-mccabe
Copy link
Copy Markdown
Collaborator

@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'?

@dan-mccabe
Copy link
Copy Markdown
Collaborator

@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.

@dan-mccabe dan-mccabe merged commit 68e7795 into main Nov 7, 2025
1 check passed
@dan-mccabe dan-mccabe deleted the deadhead_depot branch November 7, 2025 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add deadhead trips

2 participants