Skip to content

fix(parser): probabilistic LABEL is a fraction, not integer percent (100x scale bug)#3

Merged
Reddimus merged 1 commit into
mainfrom
fix/prob-fractional-label-scaling
Jun 6, 2026
Merged

fix(parser): probabilistic LABEL is a fraction, not integer percent (100x scale bug)#3
Reddimus merged 1 commit into
mainfrom
fix/prob-fractional-label-scaling

Conversation

@Reddimus

@Reddimus Reddimus commented Jun 6, 2026

Copy link
Copy Markdown
Owner

What

parse_probabilistic divided every SPC probabilistic-outlook isopleth value by
100 unconditionally, on the assumption that LABEL/dn is an integer
percent ("2", "5", "30"). The live www.spc.noaa.gov static GeoJSON and
the ArcGIS f=geojson mirror actually ship the value as an already-normalized
fraction
(LABEL = "0.02", "0.30"). Result: a 2% tornado risk parsed to
0.0002 instead of 0.02 — a 100x error on every real feed.

This was latent because the only persisting consumer (spc-data
spc.prob_outlooks) was simultaneously fetching the wrong URL and storing
nothing. Fixing that URL surfaced the scale bug.

Fix

Normalize exactly like the sibling day4-8 path (convective.cpp):

pf.probability = pct > 1.0 ? pct / 100.0 : pct;   // was: pct / 100.0

Integer percents (> 1) divide by 100; fractions (<= 1) pass through. Both
upstream forms now map to the same [0,1] probability.

Tests

  • New Parser.ProbabilisticFractionalLabel"0.02"/"0.30"0.02/0.30.
  • Parser.ProbabilisticTornado (integer "2"/"5"0.02/0.05) still green.
  • Corpus.ProbabilisticParsesAndScales tightened to a >= 0.01 floor (every real
    SPC isopleth is >= 2%), which rejects the old 0.0002 regression.

24/24 tests pass; lint + audit clean. 0.1.00.1.1 (+ CHANGELOG).

Downstream: spc-data will re-pin to v0.1.1 and re-freeze its SQL golden.

…eger percent

parse_probabilistic divided every isopleth by 100 unconditionally, so the
live www.spc.noaa.gov + ArcGIS GeoJSON form (LABEL="0.02") yielded 0.0002
instead of 0.02 — a 100x error on every real feed. Normalize like the
day4-8 path (pct > 1.0 ? pct/100 : pct): integer percents divide, fractions
pass through. Pin both forms with regression tests. Bump 0.1.0 -> 0.1.1.
@Reddimus Reddimus merged commit 9512994 into main Jun 6, 2026
3 checks passed
@Reddimus Reddimus deleted the fix/prob-fractional-label-scaling branch June 6, 2026 08:00
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