Skip to content

add deadhead trip start end times#67

Merged
dan-mccabe merged 5 commits intomainfrom
add_deadhead_trip_times
Feb 2, 2026
Merged

add deadhead trip start end times#67
dan-mccabe merged 5 commits intomainfrom
add_deadhead_trip_times

Conversation

@YiZoeHe
Copy link
Copy Markdown
Collaborator

@YiZoeHe YiZoeHe commented Jan 30, 2026

No description provided.

@YiZoeHe
Copy link
Copy Markdown
Collaborator Author

YiZoeHe commented Jan 30, 2026

I have no idea why the CI check failed. The code runs successfully on my local computer, I don't have this
error: "Properties" has no attribute "total_seconds"

@dan-mccabe
Copy link
Copy Markdown
Collaborator

@YiZoeHe thanks for taking care of this! The mypy check was failing because mypy couldn't tell that trip_duration_minutes was a timedelta column (I think it gets confused up by the .agg() call, even though the code was fine.

(base) dmccabe@dmccabe-41200s routee-transit % pixi run -e dev-py312 mypy .
nrel/routee/transit/predictor.py:456: error: "Properties" has no attribute "total_seconds"  [attr-defined]
nrel/routee/transit/predictor.py:606: error: "Properties" has no attribute "total_seconds"  [attr-defined]

I added an explicit pd.to_timedelta() wrapped around the new column so mypy doesn't get mad. I also updated the output format to just round to 2 decimals instead of converting to int, since the start_time and end_time values were including seconds and not rounded to full minutes.

I'm going to double-check the results one more time to make sure things look good but assuming that's good I'll go ahead and merge.

@YiZoeHe
Copy link
Copy Markdown
Collaborator Author

YiZoeHe commented Feb 2, 2026 via email

@dan-mccabe dan-mccabe merged commit d77c01b into main Feb 2, 2026
1 check passed
@dan-mccabe
Copy link
Copy Markdown
Collaborator

All looks good. I fixed a couple separate issues I noticed when checking the results that were not related to this PR: there was a redundant calculation of trip start and end times when estimating trip timestamps along the shape, and trip_type was getting dropped when setting a date for analysis because trip data was reloaded from scratch rather than filtered.

@dan-mccabe dan-mccabe deleted the add_deadhead_trip_times branch February 2, 2026 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.

2 participants