Skip to content

fix: measure a place's mile on its own race, at the pass the order means - #191

Merged
MikeWills merged 1 commit into
mainfrom
fix/place-mile-on-its-own-race
Sep 30, 2026
Merged

MikeWills merged 1 commit into
mainfrom
fix/place-mile-on-its-own-race

Conversation

@MikeWills

Copy link
Copy Markdown
Owner

On the Mankato roster the NCS panel read WE "Half 2.4", WF "10K 4.6", WC "Full 6.5", and unticking races on the Places tab could not change it.

Three faults, one cause: "how far along" came from index.locate

locate answers "which line is nearest" - on shared road a coin flip between races whose miles have nothing to do with each other.

  1. A place's mile ignored the races ticked for it. Now CourseIndex.place_positions: measured on a ticked race, the highest on the Courses tab if several; nearest line only for a place with no ticks, or ticks for races nowhere near it.
  2. Lead runner pace and ETA used ONE distance per stop, from the nearest line, shared by every race it serves - a Half leader's pace could come from Full miles, or run backwards and come out as nothing. Now each stop is measured on the leader's own race.
  3. A stop passed twice. The Full goes by stop I at 16.3 and 20.6; the nearer pass was 20.6, behind J at 16.8, so an I -> J leg had no pace or ETA. CourseIndex.progression picks one pass per stop so the miles never run backwards in the club's order, and of those the choice with the least total offset. (A first attempt - "first pass after the previous stop" - was caught by an existing leader test: it took a pass 200 m away over the one the stop sits on.)

geo.PlanarLine.passes lists every separate pass; progress.served_courses reads the ticks.

Checked

  • tests/test_place_miles.py (10), including a Mankato-shaped out-and-back; existing leader tests unchanged and passing; full suite 882 passed.
  • Real organizer files, locally (not committed), stadium start set, stops ticked as in live setup: every race's stops read in rising order - Full A 2.2 ... I 16.3, J 16.8 ... M 24.6; Half E 2.4 ... L 11.4; 10K A 0.4, E 3.5, F 4.6. Snapshot build 0.06 s.
  • Guides: setup.md (Races column), runbook 4c; CLAUDE.md domain rule.

Data issue this surfaced (not code)

Stop A is ticked for the Half, but the Half's line never comes within 284 m of it - beyond the 250 m limit, so A has no Half mile.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QkbtsMnQEe8HZ7xyxXHYHB

The mile beside a place came from whichever course line was nearest,
ignoring the races ticked for it, and every race's lead runner pace used
that one shared distance. Places are now measured on a ticked race (the
highest on the Courses tab), leaders on their own race, and where a race
passes a stop twice the pass is the one that keeps the club's order
non-decreasing with the least total offset - Mankato's stop I moves from
Full 20.6 (behind J) to 16.3.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QkbtsMnQEe8HZ7xyxXHYHB
@MikeWills
MikeWills merged commit b780b83 into main Sep 30, 2026
2 checks passed
@MikeWills
MikeWills deleted the fix/place-mile-on-its-own-race branch September 30, 2026 04:14
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