feat: add board-specific diving stroke codes (F/G/H)#25
Open
fsalum wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hy-Tek writes
F,G, andHin the stroke column for diving events.Strokehas no members for them, soselect_from_enumfalls back toStroke.UNKNOWN.That makes diving indistinguishable from file corruption:
UNKNOWNis 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 onUNKNOWNsilently mislabels corrupt rows as dives; skippingUNKNOWNto be safe silently discards all diving.The three chars encode the board:
Evidence
From a multi-conference corpus of hy3 files:
F+G, 4 carryF+G+H. NeverGwithoutF; neverHwithoutG.F=26 G=26 H=26,F=60 G=60 H=54,F=15 G=15 H=12.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.F, consistent with NFHS rules being 1-metre springboard only.Verification
Purely additive — no existing member's value changes, so no current behaviour shifts except that
F/G/Hstop 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/8for 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.