Skip to content

fix(bus): Add plan_stop_departure_dt to headway calculations#767

Merged
runkelcorey merged 4 commits into
mainfrom
fix-bus-planned-headways
Jun 29, 2026
Merged

fix(bus): Add plan_stop_departure_dt to headway calculations#767
runkelcorey merged 4 commits into
mainfrom
fix-bus-planned-headways

Conversation

@runkelcorey

Copy link
Copy Markdown
Collaborator

Asana Task: 🚌 Add plan_stop_departure_dt to ordering of headways

What changes does this PR propose?

  1. Makes all datetimes UTC (so they are combinable)
  2. Adds plan_stop_departure_dt to the calculation of headways

How were these changes validated?

  1. Wrote a new test dataframely class with a rule that any row with non-empty inputs should have non-empty headways

What questions should reviewers consider?

None.

@runkelcorey runkelcorey requested a review from a team as a code owner June 23, 2026 20:00
@runkelcorey runkelcorey requested a review from huangh June 23, 2026 20:00
@github-actions

Copy link
Copy Markdown

LCOV of commit 46e2b6d during Continuous Integration (Python) #1998

Summary coverage rate:
  lines......: 64.7% (3598 of 5561 lines)
  functions..: 29.9% (275 of 920 functions)
  branches...: no data found

Files changed coverage rate:
                                                                                     |Lines       |Functions  |Branches    
  Filename                                                                           |Rate     Num|Rate    Num|Rate     Num
  =========================================================================================================================
  src/lamp_py/bus_performance_manager/combined_bus_schedule.py                       |97.2%     36|50.0%     2|    -      0
  src/lamp_py/bus_performance_manager/events_gtfs_schedule.py                        | 100%     70|50.0%    10|    -      0
  src/lamp_py/bus_performance_manager/events_metrics.py                              |67.2%     58|33.3%    12|    -      0
  src/lamp_py/bus_performance_manager/events_tm_schedule.py                          | 100%     34|50.0%     2|    -      0
  src/lamp_py/tableau/conversions/convert_bus_performance_data.py                    |34.8%     23|25.0%     4|    -      0

@huangh

huangh commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Did you confirm that all these date times that were tz-less before were all tz-less UTC, and we haven't assigned UTC to EST times?

I think there's a test in there somewhere that expects the correct relative difference between time fields, but we should ensure that nothing has changed here.

@runkelcorey

Copy link
Copy Markdown
Collaborator Author

Did you confirm that all these date times that were tz-less before were all tz-less UTC, and we haven't assigned UTC to EST times?

yep!

@runkelcorey runkelcorey merged commit d9b8bfa into main Jun 29, 2026
9 checks passed
@runkelcorey runkelcorey deleted the fix-bus-planned-headways branch June 29, 2026 14:44
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