Method isTripActive able to check the delay cases in StopTimeUpdate#439
Open
TsimurSh wants to merge 4 commits intoOneBusAway:mainfrom
Open
Method isTripActive able to check the delay cases in StopTimeUpdate#439TsimurSh wants to merge 4 commits intoOneBusAway:mainfrom
TsimurSh wants to merge 4 commits intoOneBusAway:mainfrom
Conversation
isTripActive method able to check the delay cases in StopTimeUpdate
Member
|
Thanks for your contribution. Can you elaborate on the scenario you’re solving for and also add tests that validate it? |
…fsRealtimeTripLibraryTest.java
Author
|
Ok. I added a test.
The previous logic would fail in such a case because it relies on arrival/departure time values. @aaronbrethorst Take a look at. |
There was a problem hiding this comment.
Pull Request Overview
This PR addresses an issue in the Trip Library where trips with a delay (but without an arrival time) are being incorrectly marked as inactive.
- Adds a new test (testIsTripActive_WithDelayNoTimeAndScheduledTrip) to validate that trips with a delay and scheduled status are active.
- Exposes the isTripActive method via a new public getter (getIsTripActive) to facilitate testing.
- Updates the isTripActive method to return true when the last stop time has a delay and no time with a scheduled trip.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| onebusaway-transit-data-federation/src/test/java/org/onebusaway/transit_data_federation/impl/realtime/gtfs_realtime/GtfsRealtimeTripLibraryTest.java | Added a new unit test to validate delay without time handling for scheduled trips. |
| onebusaway-transit-data-federation/src/main/java/org/onebusaway/transit_data_federation/impl/realtime/gtfs_realtime/GtfsRealtimeTripLibrary.java | Exposed the isTripActive method and updated its logic to check delay cases correctly. |
.../onebusaway/transit_data_federation/impl/realtime/gtfs_realtime/GtfsRealtimeTripLibrary.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
Please take a look at this change. Unfortunately, this method will regret all trips and mark them as inactive if the tripUpdates use a delay in the stopTimeUpdate.