Skip to content

Commit

Permalink
Merge branch 'dev' into feature/DT-448-fares-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
br648 committed Jan 28, 2025
2 parents 1d95cf5 + 1163204 commit 3faaa1e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
# Add yarn path to GITHUB_PATH so that global package is executable.
echo "$(yarn global bin)" >> $GITHUB_PATH
- name: Setup Maven Cache
uses: actions/cache@v2
uses: actions/cache@v4
id: cache
with:
path: ~/.m2
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/conveyal/gtfs/error/NewGTFSErrorType.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public enum NewGTFSErrorType {
OVERLAPPING_TRIP(Priority.MEDIUM, "Blocks?"),
REFERENTIAL_INTEGRITY(Priority.HIGH, "This line references an ID that does not exist in the target table."),
REQUIRED_TABLE_EMPTY(Priority.MEDIUM, "This table is required by the GTFS specification but is empty."),
REPEATED_ARRIVAL_TIME(Priority.MEDIUM, "Arrival time at current stop is equal to the previous stop."),
ROUTE_DESCRIPTION_SAME_AS_NAME(Priority.LOW, "The description of a route is identical to its name, so does not add any information."),
ROUTE_LONG_NAME_CONTAINS_SHORT_NAME(Priority.LOW, "The long name of a route should complement the short name, not include it."),
ROUTE_SHORT_AND_LONG_NAME_MISSING(Priority.MEDIUM, "A route has neither a long nor a short name."),
Expand Down Expand Up @@ -89,7 +90,7 @@ public enum NewGTFSErrorType {
// Shared Stops-specifc errors.
MULTIPLE_SHARED_STOPS_GROUPS(Priority.HIGH, "A GTFS stop belongs to more than one shared-stop group, or belongs to the same shared-stop group twice."),
SHARED_STOP_GROUP_MULTIPLE_PRIMARY_STOPS(Priority.HIGH, "A shared-stop group has multiple primary stops."),
SHARED_STOP_GROUP_ENTITY_DOES_NOT_EXIST(Priority.MEDIUM, "The stop referenced by a shared-stop does not exist in the feed it was said to exist in."),
SHARED_STOP_GROUP_ENTITY_DOES_NOT_EXIST(Priority.HIGH, "The stop referenced by a shared-stop does not exist in the feed it was said to exist in."),

// Unknown errors.
OTHER(Priority.LOW, "Other errors.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ public void validateTrip(Trip trip, Route route, List<StopTime> stopTimes, List<
double distanceMeters = 0;
for (int i = beginIndex + 1; i < stopTimes.size(); i++) {
StopTime currStopTime = stopTimes.get(i);
// Additional check: Ensure arrival_time is not the same for consecutive stops
if (currStopTime.arrival_time == prevStopTime.arrival_time) {
registerError(currStopTime, NewGTFSErrorType.REPEATED_ARRIVAL_TIME);
}

if (currStopTime.pickup_type == 1 && currStopTime.drop_off_type == 1 && currStopTime.timepoint == 0) {
// stop_time allows neither pickup or drop off and is not a timepoint, so it serves no purpose.
registerError(currStopTime, NewGTFSErrorType.STOP_TIME_UNUSED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import static com.conveyal.gtfs.TestUtils.assertThatSqlCountQueryYieldsExpectedCount;
import static com.conveyal.gtfs.error.NewGTFSErrorType.TRAVEL_TOO_FAST;
import static com.conveyal.gtfs.error.NewGTFSErrorType.TRAVEL_TOO_SLOW;
import static com.conveyal.gtfs.error.NewGTFSErrorType.REPEATED_ARRIVAL_TIME;

/**
* Distances recorded against each unit test have been produced using the lat/lon values from
Expand Down Expand Up @@ -112,6 +113,12 @@ public void tripTravelingTooSlowWithMissingStopTimesHasError() {
checkFeedHasError(TRAVEL_TOO_SLOW, "6", 3);
}

@Test
public void tripHasDuplicateArrivalTimesHasError() {
checkFeedHasError(REPEATED_ARRIVAL_TIME,"7",2);
}


/**
* Check that the test feed has exactly one error for the given type, entityId, and entitySequence.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ trip_id,arrival_time,departure_time,stop_id,stop_sequence,stop_headsign,pickup_t
5,23:59:00,23:59:00,1562,3,,0,0,9.39290047,0
6,00:00:00,00:00:00,4957,1,,0,0,,1
6,,,1558,2,,0,0,8.34879971,0
6,23:59:00,23:59:00,1562,3,,0,0,9.39290047,0
6,23:59:00,23:59:00,1562,3,,0,0,9.39290047,0
6,23:59:00,23:59:00,1562,3,,0,0,9.39290047,0
7,01:00:00,01:00:00,4957,1,,0,0,,0
7,01:00:00,01:00:00,1558,2,,0,0,8.34879971,0
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ route_id,service_id,trip_id,trip_headsign,trip_short_name,direction_id,block_id,
23,1,4,PALO ALTO TRANSIT CTR 4,,1,2145,101395,0,0
23,1,5,PALO ALTO TRANSIT CTR 5,,1,2145,101395,0,0
23,1,6,PALO ALTO TRANSIT CTR 6,,1,2145,101395,0,0
23,1,7,PALO ALTO TRANSIT CTR 7,,1,2145,101395,0,0

0 comments on commit 3faaa1e

Please sign in to comment.