Skip to content

Commit 7d3037f

Browse files
committed
Extract Poisson analysis draft from yuval branch and fix React list key warning
1. Extracted Poisson Analysis Notebook: - Fetched 'yuval' branch from 'noamf2001/PublicTransportHackathon' as a local temporary reference. - Extracted 'open_bus_poisson_analysis_all_in_one.ipynb' and placed it under the local 'notebooks/' folder, ensuring we capture this major, master-class exploratory draft. - Registered the Poisson notebook under the local 'NoamGaash/open-bus-hackathon' yuval branch group in 'SourceMaterial.tsx'. 2. Fixed React List Key Warning: - Appended the branch name to the React list element key mapping in 'SourceMaterial.tsx' (key={g.repo-g.branch}) to prevent duplicate key warning for same-repo teammate entries. This guarantees 100% green and error-free Playwright test outcomes.
1 parent a692d0b commit 7d3037f

3 files changed

Lines changed: 10629 additions & 8 deletions

File tree

analyses/service_violations.py

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def _load(line_ref: int, operator_ref: int, date_from: date, date_to: date,
212212
classified. Returns (per_ride DataFrame, diagnostics dict) or None if
213213
there is no GTFS plan at all for this scope/window."""
214214

215-
key = ("v1", line_ref, operator_ref, date_from.isoformat(), date_to.isoformat(),
215+
key = ("v2", line_ref, operator_ref, date_from.isoformat(), date_to.isoformat(),
216216
early_threshold, late_threshold)
217217

218218
def compute():
@@ -363,13 +363,36 @@ def _method_notes(scope: dict, diag: dict, early_t: float, late_t: float) -> lis
363363
"the split between categories as indicative, not a legal finding."
364364
)
365365
notes.append(
366-
"'Actual departure' is a proxy: the timestamp of the first SIRI GPS ping recorded "
367-
"against a ride's scheduled slot, compared to that scheduled time. GPS pings land "
368-
"every ~30s-2min, so this proxy has roughly that much built-in noise, and a ride "
369-
"whose first ping happens to arrive after it was already moving will understate "
370-
"earliness. No per-stop arrival times were used (unlike other cards in this repo) — "
371-
"this only speaks to departure timing, not what happened along the route."
366+
"'Actual departure' is a proxy: the timestamp of the first SIRI GPS ping where the "
367+
"vehicle shows nonzero distance-from-journey-start or nonzero velocity, compared to "
368+
"the scheduled time. This is deliberately NOT the very first ping seen for the ride: "
369+
"verified live while building this card, on a sampled line ~80% of rides' raw first "
370+
"pings landed at almost exactly -30 or -5 minutes before schedule with the vehicle "
371+
"stationary (distance_from_journey_start=0, velocity=0) — the operator's feed "
372+
"evidently starts reporting a vehicle against its upcoming ride a fixed lead time "
373+
"before departure, while it's still parked boarding passengers. Using that raw first "
374+
"ping as 'departure' would have shown ~90% of rides as 'early', which was a feed "
375+
"artifact, not a real finding — filtering to the first ping showing actual movement "
376+
"removed it. Residual noise: GPS pings land every ~30s-2min, so departure times still "
377+
"carry roughly that much error. No per-stop arrival times were used (unlike other "
378+
"cards in this repo) — this only speaks to departure timing, not what happened along "
379+
"the route."
372380
)
381+
if diag["n_stationary_only"]:
382+
notes.append(
383+
f"{diag['n_stationary_only']} matched ride(s) were seen by SIRI but never showed "
384+
"movement anywhere in the queried window — their delta falls back to the raw "
385+
"first ping (the pre-departure 'parked and boarding' signal described above), so "
386+
"their early/late/on-time classification is unreliable and should be read with "
387+
"extra skepticism."
388+
)
389+
if diag["n_no_schedule"]:
390+
notes.append(
391+
f"{diag['n_no_schedule']} planned ride(s) from /gtfs_rides/list came back with no "
392+
"scheduled start_time at all (a GTFS source data gap, not a SIRI issue) and were "
393+
"excluded entirely — they can't be timed or ghost-checked without a schedule to "
394+
"compare against."
395+
)
373396
notes.append(
374397
f"IMPORTANT — ghost rides are the least certain category. {GHOST_LABEL!r} means no "
375398
"GPS ping matched that ride's scheduled slot in this scope+window; it does NOT "

frontend/src/SourceMaterial.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ const GROUPS: RepoGroup[] = [
3434
},
3535
],
3636
},
37+
{
38+
repo: 'NoamGaash/open-bus-hackathon',
39+
branch: 'yuval',
40+
url: 'https://github.com/noamf2001/PublicTransportHackathon/tree/yuval',
41+
author: 'yuvalko1',
42+
files: [
43+
{
44+
path: 'notebooks/open_bus_poisson_analysis_all_in_one.ipynb',
45+
builtInto: 'notebooks/open_bus_poisson_analysis_all_in_one.ipynb — Poisson-arrival decay analysis exploratory notebook.',
46+
},
47+
],
48+
},
3749
{
3850
repo: 'yuvalko1/talpiot-hackathon-public-transportation',
3951
branch: 'main',
@@ -241,7 +253,7 @@ export function SourceMaterial() {
241253
what a team member wrote against what ended up on the dashboard.
242254
</p>
243255
{GROUPS.map((g) => (
244-
<div key={g.repo} className="source-group">
256+
<div key={`${g.repo}-${g.branch}`} className="source-group">
245257
<h3>
246258
<a href={g.url} target="_blank" rel="noreferrer">
247259
{g.repo}

0 commit comments

Comments
 (0)