-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Realtime stops vectortile layer checks whether there are stoptimes on the service day #5861
Realtime stops vectortile layer checks whether there are stoptimes on the service day #5861
Conversation
List.of(new KeyValue("closedByServiceAlert", noServiceAlert)) | ||
List.of( | ||
new KeyValue("closedByServiceAlert", noServiceAlert), | ||
new KeyValue("noServiceOnServiceDay", !stopTimesExist) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to turn this around? Basically you state what exists (services) and not what doesn't exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double negatives (noService=false) always make my head hurt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course! Sorry about that.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5861 +/- ##
=============================================
+ Coverage 68.37% 68.38% +0.01%
- Complexity 16673 16678 +5
=============================================
Files 1914 1914
Lines 72652 72659 +7
Branches 7452 7452
=============================================
+ Hits 49673 49686 +13
+ Misses 20422 20416 -6
Partials 2557 2557 ☔ View full report in Codecov by Sentry. |
.../org/opentripplanner/ext/vectortiles/layers/stops/DigitransitRealtimeStopPropertyMapper.java
Outdated
Show resolved
Hide resolved
…DigitransitRealtimeStopPropertyMapper.java Co-authored-by: Leonard Ehrenfried <[email protected]>
List.of(new KeyValue("closedByServiceAlert", noServiceAlert)) | ||
List.of( | ||
new KeyValue("closedByServiceAlert", noServiceAlert), | ||
new KeyValue("servicesRunningOnServiceDay", stopTimesExist) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most of the time we call it ServiceDate instead of ServiceDay.
@@ -32,10 +34,19 @@ protected Collection<KeyValue> map(RegularStop stop) { | |||
.stream() | |||
.anyMatch(alert -> alert.noServiceAt(currentTime)); | |||
|
|||
var serviceDate = LocalDate.now(transitService.getTimeZone()); | |||
boolean stopTimesExist = transitService | |||
.getStopTimesForStop(stop, serviceDate, ArrivalDeparture.BOTH, true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to quickly take a look if this also includes stop times for patterns that have been added through an realtime update but I'm not sure. However, if it doesn't, I think we have plenty of other api calls which are also broken in that sense so maybe we shouldn't care about it for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like the realtimes are added as the stopTimesHelper.stopTimesForStop fetches the patterns with includeRealtimeUpdates set as true.
PR Instructions
Summary
A badge needs to be displayed on the map for stops without traffic on the service day. The vectortile layer for realtime stops checks if stop times exist for a particular stop and returns the result.
Issue
Unit tests