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
Import Occupancy Status from GTFS-RT Vehicle Positions #5372
Import Occupancy Status from GTFS-RT Vehicle Positions #5372
Conversation
src/ext/java/org/opentripplanner/ext/gtfsgraphqlapi/model/TripOccupancy.java
Outdated
Show resolved
Hide resolved
src/ext/java/org/opentripplanner/ext/transmodelapi/mapping/OccupancyStatusMapper.java
Outdated
Show resolved
Hide resolved
...g/opentripplanner/standalone/config/routerconfig/updaters/VehiclePositionsUpdaterConfig.java
Show resolved
Hide resolved
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev-2.x #5372 +/- ##
=============================================
+ Coverage 66.60% 66.64% +0.04%
- Complexity 15279 15397 +118
=============================================
Files 1790 1794 +4
Lines 69364 69682 +318
Branches 7306 7345 +39
=============================================
+ Hits 46197 46437 +240
- Misses 20690 20757 +67
- Partials 2477 2488 +11
☔ View full report in Codecov by Sentry. |
Was it that we use the config change label only when we create breaking changes? I will try to avoid doing that here (just need to figure out how to set default for the features). |
src/main/java/org/opentripplanner/service/realtimevehicles/model/RealtimeVehicleBuilder.java
Outdated
Show resolved
Hide resolved
src/ext/java/org/opentripplanner/ext/gtfsgraphqlapi/datafetchers/TripImpl.java
Outdated
Show resolved
Hide resolved
...ava/org/opentripplanner/service/realtimevehicles/internal/DefaultRealtimeVehicleService.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opentripplanner/updater/vehicle_position/RealtimeVehiclePatternMatcher.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opentripplanner/updater/vehicle_position/RealtimeVehicleMatcherTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/opentripplanner/updater/vehicle_position/RealtimeVehicleMatcherTest.java
Outdated
Show resolved
Hide resolved
src/ext/java/org/opentripplanner/ext/gtfsgraphqlapi/datafetchers/VehiclePositionImpl.java
Outdated
Show resolved
Hide resolved
src/ext/java/org/opentripplanner/ext/gtfsgraphqlapi/generated/graphql-codegen.yml
Outdated
Show resolved
Hide resolved
src/ext/java/org/opentripplanner/ext/gtfsgraphqlapi/datafetchers/TripOccupancyImpl.java
Outdated
Show resolved
Hide resolved
...ava/org/opentripplanner/service/realtimevehicles/internal/DefaultRealtimeVehicleService.java
Show resolved
Hide resolved
We went through the renaming commit issues with @t2gran today and came to the conclusion that it's not worth it to recreate commits to avoid missing history as the problem was only affecting a few small files. |
This branch has conflicts. |
@sam-hickey-ibigroup You will be interested to hear that realtime occupancy information is coming to OTP. |
src/ext/java/org/opentripplanner/ext/transmodelapi/model/EnumTypes.java
Outdated
Show resolved
Hide resolved
src/ext/java/org/opentripplanner/ext/transmodelapi/model/EnumTypes.java
Outdated
Show resolved
Hide resolved
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.
Almost there ...
* a module for the repository as well as the service. | ||
*/ | ||
@Module | ||
public interface RealtimeVehicleRepositoryModule { |
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.
Naming:
public interface RealtimeVehicleRepository {
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.
Hmm we already have a RealtimeVehicleRepository, this is a different class.
* a module for the service without the repository, which is injected from the loading phase. | ||
*/ | ||
@Module | ||
public interface RealtimeVehicleServiceModule { |
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.
Rename:
public interface RealtimeVehicleService {
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.
Same as above
List<T> dft = (defaultValues instanceof List<T>) | ||
? (List<T>) defaultValues | ||
: List.copyOf(defaultValues); |
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 would put this into ListUtils (or create CollectionsUtils
):
@Nullable
public static <T> toString(Collection<T> c) {
if(c == null) {
return null;
}
return ((c instanceof List<T> list) ? list : List.copyOf(defaultValues)).toString();
}
Note! This is also handling null
. If we should return "[]"
and not null
is a matter of taste. Both will work here.
src/main/java/org/opentripplanner/standalone/config/framework/json/ParameterBuilder.java
Outdated
Show resolved
Hide resolved
* If vehicle/carriage is not in use / unavailable, or passengers are only allowed to alight due to e.g. crowding | ||
* The vehicle or carriage is not accepting passengers. |
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.
Tip: If you do not want to maintain all this doc in multiple places you could use the DocumentedEnum
interface.
Co-authored-by: Thomas Gran <t2gran@gmail.com>
…json/ParameterBuilder.java Co-authored-by: Thomas Gran <t2gran@gmail.com>
...ava/org/opentripplanner/service/realtimevehicles/internal/DefaultRealtimeVehicleService.java
Outdated
Show resolved
Hide resolved
…ernal/DefaultRealtimeVehicleService.java Co-authored-by: Leonard Ehrenfried <mail@leonard.io>
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 we want to also generate the documentation for the default values of enum sets but that can come in a separate PR.
Summary
Issue
closes #5364
Unit tests
Added
Documentation
Updated but might need slightly more
Changelog
From title