Skip to content
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

Relax rejection of GTFS flex trips that also contain continuous stopping #6231

Merged
merged 7 commits into from
Nov 19, 2024

Conversation

leonardehrenfried
Copy link
Member

Summary

This brings OTP in line with the GTFS spec by allowing flex and continuous stopping in the same trip as long as it's not mixed in the very same stop time.

There is also a small improvement to the debug UI where routes without a publicCode/shortName use the long name as the fallback.

Issue

Closes #6230

Unit tests

The majority of the code is test refactoring. Lots of tests for this behavior added.

Documentation

n/a

Bumping the serialization version id

I'm changing static method on a file that is being serialised so I'm bumping just in case.

@leonardehrenfried leonardehrenfried added Bug TriMet GTFS Related to import of GTFS data IBI Developed by or important for IBI Group labels Nov 5, 2024
@leonardehrenfried leonardehrenfried requested a review from a team as a code owner November 5, 2024 16:51
Copy link

codecov bot commented Nov 5, 2024

Codecov Report

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

Project coverage is 69.71%. Comparing base (87b6a46) to head (6cd9ed8).
Report is 157 commits behind head on dev-2.x.

Files with missing lines Patch % Lines
.../org/opentripplanner/ext/flex/FlexTripsMapper.java 50.00% 0 Missing and 1 partial ⚠️
...ipplanner/ext/flex/trip/ScheduledDeviatedTrip.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev-2.x    #6231      +/-   ##
=============================================
- Coverage      69.75%   69.71%   -0.05%     
- Complexity     17652    17695      +43     
=============================================
  Files           2007     2008       +1     
  Lines          75563    75834     +271     
  Branches        7731     7765      +34     
=============================================
+ Hits           52711    52865     +154     
- Misses         20141    20256     +115     
- Partials        2711     2713       +2     

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


🚨 Try these New Features:

@leonardehrenfried
Copy link
Member Author

@m-mcqueen @fpurcell If you want to you can try out this version and deploy it to your servers before review has concluded.

@leonardehrenfried leonardehrenfried added the bump serialization id Add this label if you want the serialization id automatically bumped after merging the PR label Nov 5, 2024
public static StopTime areaWithContinuousStopping(String time) {
var st = area(time, time);
st.setFlexContinuousPickup(PickDrop.COORDINATE_WITH_DRIVER);
st.setFlexContinuousDropOff(PickDrop.COORDINATE_WITH_DRIVER);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does continuous drop-off imply continuous pick-up? (That also makes this test case overlap with the next one.)

Copy link
Member Author

Choose a reason for hiding this comment

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

In the spec these are completely different things but of course you would be hard pressed to find an example in the real world where you can only be dropped off continuously but not picked up.

Copy link
Contributor

@binh-dam-ibigroup binh-dam-ibigroup left a comment

Choose a reason for hiding this comment

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

CobbLinc flex service, used in the tests, has been discontinued. I don't mind continue using the feed for the former service as long as we say in the code that the service no longer exists. Or, we can use a current feed of another agency.

* contains both flex zones but also scheduled stops. Inside the zone, passengers can get on or off
* anywhere, so there it works more like a taxi.
* <p>
* Read about the details at: https://www.cobbcounty.org/transportation/cobblinc/routes-and-schedules/flex
Copy link
Contributor

Choose a reason for hiding this comment

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

Cobb County no longer offers the transit flex service described and switched it to an on-demand micromobility service which is no-longer fare-integrated with the rest of CobbLinc. (And the link is broken as a result.) Should we use a different feed that contains a service to the former flex service?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we want to have fewer integration tests and more unit tests, so I would just update the Javadoc.

@leonardehrenfried leonardehrenfried merged commit 76f113e into opentripplanner:dev-2.x Nov 19, 2024
6 checks passed
@leonardehrenfried leonardehrenfried deleted the flex-continuous branch November 19, 2024 11:17
t2gran pushed a commit that referenced this pull request Nov 19, 2024
t2gran pushed a commit that referenced this pull request Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug bump serialization id Add this label if you want the serialization id automatically bumped after merging the PR GTFS Related to import of GTFS data IBI Developed by or important for IBI Group TriMet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rejection of continuous stopping in flex trips is overly strict
3 participants