Skip to content

Dev - #136

Merged
rafapereirabr merged 8 commits into
mainfrom
dev
Nov 1, 2026
Merged

Dev#136
rafapereirabr merged 8 commits into
mainfrom
dev

Conversation

@rafapereirabr

Copy link
Copy Markdown
Collaborator

closes #131 #133 #134 #135

rafapereirabr and others added 8 commits November 1, 2026 00:18
…uration)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
set_min_speed() raises the speed of trip spans slower than min_speed,
shifting the later times of each trip earlier and keeping dwell times. It
mirrors set_max_speed(): both now call the internal limit_trip_speed()
helper, whose behaviour in max mode is unchanged. Argument checks stay in
the exported functions, and warn_missing_ids() gains a call argument, so
warnings and errors are still attributed to the exported functions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fix_gtfs() passes overwrite_stop_times (default FALSE, last argument so
positional calls keep working) to interpolate_stop_times(overwrite = ).
set_dwell_time()'s default strategy is "shift_trip_end": the docs, NEWS
and tests still said "push_trip_end".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Many feeds write times after midnight as "00:30:00" instead of
"24:30:00", so trips that cross midnight seem to go back in time and
durations, speeds, time-of-day selections and interpolation come out
wrong.

New fix_overnight_times() rewrites these times to the GTFS form (a step
back of more than 12 hours is taken as midnight; frequencies end_times
earlier than start_times are moved a day later), and fix_gtfs() runs it
first. The functions that calculate or change durations and speeds,
interpolate_stop_times(), build_graph() and the time-of-day functions
(filter_by_time_of_day(), get_route_frequency(), set_route_frequency(),
get_stop_frequency(), get_vkt(), get_vmt(), get_trip_length() segment
windows, get_summary()) fix them silently before using them. Each
function checks its own feed, so nested calls find the times already
fixed and don't change or copy them again. Internal helper
has_overnight_trips() reports whether a feed needs the fix.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolves conflicts with set_dwell_time(strategy), set_min_speed() and
fix_gtfs(overwrite_stop_times): NEWS keeps both sides' bullets,
fix_gtfs() documents fix_overnight_times() as step 3 before the speed
cap and the interpolation (with overwrite_stop_times), and
limit_trip_speed() fixes the times once for both set_max_speed() and
set_min_speed(), whose docs now say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rafapereirabr
rafapereirabr merged commit efd56a1 into main Nov 1, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new features to interpolate_stop_times

1 participant