Skip to content

Handle duration tags for elevators in the same way as for escalators #6568

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

tkalvas
Copy link
Contributor

@tkalvas tkalvas commented Mar 24, 2025

Summary

Elevators can now also have a hh:mm:ss format duration tag in OSM, and we recognize them.

Issue

The way we handled elevator duration tags was against OSM data spec.

Unit tests

The OsmProcessors are hard to test, and because of that are undertested. I added one here.

Changelog

Yes.

Bumping the serialization version id

Yes.

@tkalvas tkalvas requested a review from a team as a code owner March 24, 2025 14:23
@tkalvas tkalvas added Improvement A functional improvement bump serialization id Add this label if you want the serialization id automatically bumped after merging the PR labels Mar 24, 2025
@leonardehrenfried leonardehrenfried changed the title handle duration tags for elevators in the same way as for escalators Handle duration tags for elevators in the same way as for escalators Mar 24, 2025
@optionsome optionsome removed the bump serialization id Add this label if you want the serialization id automatically bumped after merging the PR label Mar 25, 2025
var from = edge.getFromVertex();
var req = StreetSearchRequest.of().withMode(StreetMode.WALK);
var res = edge.traverse(new State(from, req.build()))[0];
assertEquals(62_000, res.getTimeDeltaMilliseconds());
Copy link
Member

Choose a reason for hiding this comment

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

This PR is fine as it is but where do you stand about allowing getters just for tests instead of testing the traversal logic in the same test?

If you are fine with it, this can be split in two tests, but it's not a requirement for my approval.

Copy link

codecov bot commented Mar 26, 2025

Codecov Report

Attention: Patch coverage is 84.61538% with 2 lines in your changes missing coverage. Please review.

Project coverage is 70.29%. Comparing base (f1c8c6f) to head (27457e7).
Report is 29 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
...er/graph_builder/module/osm/ElevatorProcessor.java 81.81% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6568      +/-   ##
=============================================
+ Coverage      70.25%   70.29%   +0.04%     
- Complexity     18388    18393       +5     
=============================================
  Files           2088     2088              
  Lines          77419    77419              
  Branches        7842     7840       -2     
=============================================
+ Hits           54387    54419      +32     
+ Misses         20263    20229      -34     
- Partials        2769     2771       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@leonardehrenfried leonardehrenfried left a comment

Choose a reason for hiding this comment

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

This looks already pretty great. However, I had a few requests about the tests but rather than playing review ping pong I chose to make the changes myself.

leonardehrenfried@30f048e

If you agree with these, can you cherry pick the commit into this branch. Then this is good to merge IMO.

@optionsome optionsome added this to the 2.8 (next release) milestone Mar 27, 2025
@optionsome optionsome merged commit 8290195 into opentripplanner:dev-2.x Mar 27, 2025
6 checks passed
@optionsome optionsome deleted the escalator-duration-parse branch March 27, 2025 10:30
t2gran pushed a commit that referenced this pull request Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement A functional improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants