Skip to content

Add days-without-cancellations score (methods 1 and 2) - #1

Open
Broundal wants to merge 1 commit into
hasadna:mainfrom
Broundal:orion/days-without-cancellations
Open

Add days-without-cancellations score (methods 1 and 2)#1
Broundal wants to merge 1 commit into
hasadna:mainfrom
Broundal:orion/days-without-cancellations

Conversation

@Broundal

Copy link
Copy Markdown

Scores a bus line by the fraction of the last 15 service days on which no ride was cancelled, and rolls that up to every line of one operator with a chart.

Data comes from /rides_execution/list (a null actual_start_time is the cancellation signal), verified live against the API — the aggregate endpoint is unusable here because num_actual_rides is always 0. The markdown records that check plus five caveats the implementation has to handle: line_ref is per direction+alternative and the set drifts within a window, rows with a null planned_start_time must be dropped, one departure can appear under several gtfs_ride_ids, actual_start_time is a flag rather than an observed time, and day bucketing needs real Asia/Jerusalem rather than a fixed UTC+3.

Lines reporting zero actuals for the whole window are marked no_actuals and kept out of the mean — that is an ingestion gap, not a company that cancelled every bus (Carmelit shows exactly this).

Charts included for בית שמש אקספרס (0.43), דן באר שבע (0.70) and גלים (0.81).

Scores a bus line by the fraction of the last 15 service days on which
no ride was cancelled, and rolls that up to every line of one operator
with a chart.

Data comes from /rides_execution/list (a null actual_start_time is the
cancellation signal), verified live against the API — the aggregate
endpoint is unusable here because num_actual_rides is always 0. The
markdown records that check plus five caveats the implementation has to
handle: line_ref is per direction+alternative and the set drifts within
a window, rows with a null planned_start_time must be dropped, one
departure can appear under several gtfs_ride_ids, actual_start_time is a
flag rather than an observed time, and day bucketing needs real
Asia/Jerusalem rather than a fixed UTC+3.

Lines reporting zero actuals for the whole window are marked no_actuals
and kept out of the mean — that is an ingestion gap, not a company that
cancelled every bus (Carmelit shows exactly this).

Charts included for בית שמש אקספרס (0.43), דן באר שבע (0.70) and
גלים (0.81).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
NoamGaash added a commit that referenced this pull request Jul 31, 2026
…val charts

This merge integrates the 'orion' group's 'Days without cancellations' quality scores materials from PR #1 and further optimizes the dashboard to support high-fidelity matplotlib renderings with fallback interactive tables.

1. 'Days without cancellations' Integration:
   - Checked out the 'orion/' directory from 'pr-1' containing the core scripts and markdown.
   - Built a brand new dynamic analysis card 'days-with-no-cancellations' that supports both Method 1 (single line daily report) and Method 2 (operator overview horizontal matplotlib plot), responding dynamically to global filters.

2. Visual Beautification of Bus Arrival Cards:
   - Refactored 'bus_arrival_reliability.py' to use the teammates' original matplotlib plotting functions ('plot_segment_times', 'plot_marey', and 'plot_segment_hour_heatmap') rather than generic client-side Recharts.
   - Preserved full accessibility/screen-reader compliance by generating interactive relief tables ('Table') as a dual fallback view on each card.

3. Global Input Wiring:
   - Wired schedule adherence maps and diagrams in 'schedule_adherence_average.py' to global search filters so that any query (e.g. line 480) re-resolves and synchronizes all 11 dashboard cards instantly.
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.

1 participant