Skip to content

feat: add board-specific diving stroke codes (F/G/H)#25

Open
fsalum wants to merge 2 commits into
SwimComm:masterfrom
fsalum:feat/diving-stroke
Open

feat: add board-specific diving stroke codes (F/G/H)#25
fsalum wants to merge 2 commits into
SwimComm:masterfrom
fsalum:feat/diving-stroke

Conversation

@fsalum

@fsalum fsalum commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Hy-Tek writes F, G, and H in the stroke column for diving events. Stroke has no members for them, so select_from_enum falls back to Stroke.UNKNOWN.

That makes diving indistinguishable from file corruption: UNKNOWN is the catch-all for any unrecognized byte, so a consumer cannot tell "this event is diving" from "this file is damaged" — and the two demand opposite handling. Keying diving detection on UNKNOWN silently mislabels corrupt rows as dives; skipping UNKNOWN to be safe silently discards all diving.

The three chars encode the board:

DIVING_1M       = "F"   # 1-metre springboard
DIVING_3M       = "G"   # 3-metre springboard
DIVING_PLATFORM = "H"   # platform

Evidence

From a multi-conference corpus of hy3 files:

  • Across 13 multi-diving-event files the chars nest strictly — 8 files carry F+G, 4 carry F+G+H. Never G without F; never H without G.
  • Per-file counts line up as parallel events: F=26 G=26 H=26, F=60 G=60 H=54, F=15 G=15 H=12.
  • All three carry the same dive count in the distance column within a meet (6 and 11 respectively), so all three are diving rather than some other event type.
  • Median scores ascend F < G < H (276.9 / 324.75 / 329.75 and 281.33 / 316.5 / 397.55), matching increasing degree of difficulty from 1-metre to 3-metre to platform.
  • High-school meets emit only F, consistent with NFHS rules being 1-metre springboard only.

Verification

select_from_enum(Stroke, "F") is Stroke.DIVING_1M
select_from_enum(Stroke, "G") is Stroke.DIVING_3M
select_from_enum(Stroke, "H") is Stroke.DIVING_PLATFORM
select_from_enum(Stroke, "A") is Stroke.FREESTYLE     # unchanged
select_from_enum(Stroke, "Z") is Stroke.UNKNOWN       # unchanged

Purely additive — no existing member's value changes, so no current behaviour shifts except that F/G/H stop being reported as unknown. The existing test suite passes.

On the omitted numeric aliases

Other members carry ("A", "1", 1) style triples. These three deliberately do not.

Extrapolating 6/7/8 for diving is unverified: no file in the corpus was observed writing a numeric stroke code for a diving event, and a wrong alias would silently mis-map some other numeric code onto diving. select_from_enum(Stroke, …) is only ever called with a single stroke-column character (extract(line, 22, 1)), so the character form is sufficient. Happy to add the numeric forms if you can confirm what Hy-Tek actually writes there.

Note for downstream consumers

For a diving event Hy-Tek puts the dive count (11 for championship format, 6 for dual) in the distance column, and the judged score in the time field. Neither means what its name suggests — a dive score parsed as a time will sort backwards, since higher is better.

fsalum added 2 commits July 20, 2026 00:07
Hy-Tek uses three diving stroke chars, not one: F = 1-metre
springboard, G = 3-metre springboard, H = platform. The prior
DIVING = "F", "6", 6 treated F as the only diving code and
extrapolated numeric aliases "6"/6 from the FREESTYLE..MEDLEY
pattern (1..5) with no corpus evidence Hy-Tek ever writes those
in the stroke column for diving -- a wrong alias could silently
mis-map some other numeric code onto diving.

Measured on a real corpus: 2012 PAC-12 (F=26 G=26 H=26), 2007 SEC
(F=60 G=60 H=54), 2005 PAC-10 (F=15 G=15 H=12) all show three
parallel diving events. Across 13 multi-diving-event files, G
never appears without F and H never appears without G (strict
nesting). Dive counts match within a meet across chars, and
median scores ascend F < G < H, tracking increasing degree of
difficulty. HS meets emit only F, consistent with NFHS being
1-metre only.

G and H previously fell through select_from_enum() to UNKNOWN,
silently dropping all 3-metre and platform diving results.

Drop the numeric aliases; use the character form only, since
select_from_enum(Stroke, ...) is only ever called with a single
extracted stroke-column char (hy3) or event_stroke field (hyv),
never a numeric value, in the whole codebase.
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