Skip to content

Commit

Permalink
Merge pull request #6298 from ibi-group/flex-duration
Browse files Browse the repository at this point in the history
Switch GTFS flex `safe_duration_offset` back to seconds
  • Loading branch information
leonardehrenfried authored Dec 4, 2024
2 parents 27b18bd + 7aea107 commit 684b841
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private Optional<TimePenalty> mapSafeTimePenalty(org.onebusaway.gtfs.model.Trip
} else {
var offset = rhs.getSafeDurationOffset() == null
? Duration.ZERO
: Duration.ofMinutes(rhs.getSafeDurationOffset().longValue());
: Duration.ofSeconds(rhs.getSafeDurationOffset().longValue());
var factor = rhs.getSafeDurationFactor() == null
? 1d
: rhs.getSafeDurationFactor().doubleValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ void testFlexFactorAndOffset(

private static Stream<Arguments> provideOffsetAndFactor() {
return Stream.of(
Arguments.of(1.5d, 60d, 1.5d, Duration.ofHours(1)),
Arguments.of(null, 120d, 1d, Duration.ofHours(2)),
Arguments.of(1.5d, 60d, 1.5d, Duration.ofMinutes(1)),
Arguments.of(null, 120d, 1d, Duration.ofMinutes(2)),
Arguments.of(1.5d, null, 1.5d, Duration.ZERO)
);
}
Expand Down

0 comments on commit 684b841

Please sign in to comment.