Repository navigation
fix(models): handle zero fallbacks, degenerate rings, and categorical dn - #57
Merged
Merged
Conversation
3 tasks done
Reddimus
added a commit
that referenced
this pull request
Nov 23, 2026
## Summary `parse_storm_reports` took a `(0, 0)` location to mean the Point was missing (`LonLat` defaults to `(0, 0)`). So a Point at exactly `(0, 0)` was replaced by the `lon`/`lat` in the properties. A `has_point` flag now records whether the Point's coordinates were read, and the properties are used only when they weren't. #57 fixed the same 0-as-absent bug for `magf` and `LABEL`; this is the case it missed. Nothing else changes: a missing, null, or non-numeric Point still falls back to the property `lon`/`lat`, and the golden IEM fixture (624 reports, none at `(0, 0)`) gives the same output. ## Testing - [x] Added `Parser.StormReportPointAtOriginIsKept`. It failed before the fix (feature 0 came back as `(-97.5, 37.7)`) and passes after it. - [x] `make test` (210/210, golden and parity unchanged), `make lint`, `make lint-md`, `make fixtures-check`, `make test-consumers` - [ ] clang-tidy: not run locally, because Homebrew LLVM 18 can't link against this Mac's SDK. CI's tidy job covers it. Fixes #59
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.
Summary
Fixes five parser edge cases reported in #52–#56:
detail::try_json_number_or_numeric_stringreturningstd::optional<double>sonormalized_probabilityandparse_storm_reportsdistinguish a present numeric0/"0"inLABEL/label/magffrom an absent or unreadable key instead of falling through todnormagnitude.parse_ringsand Esriparse_esri_rings_with_budgetso callers'!rings.empty()gate cannot be bypassed.dnfallback (parse_categorical drops a dn-only feature: the dn label fallback can never work (numeric dn unread, string dn unmapped) #55): Map numeric and numeric-stringdncodes (2=TSTM,3=MRGL,4=SLGT,5=ENH,6=MDT,8=HIGH) inparse_categoricalwhenLABEL/labelare absent. Note: per NOAA's liveSPC_wx_outlks/MapServer/1?f=jsonrenderer,HIGHisdn = 8(not7;7is unused).Testing
make format && make lint && make lint-md && make fixtures-checkmake test CMAKE_ARGS=-DSPC_WARNINGS_AS_ERRORS=ON(all golden and parity tests unchanged)make test-consumers201/201each)tools/verify_arcgis_metadata.py(39/39 layers) and all 6 live examplesFixes #52
Fixes #53
Fixes #54
Fixes #55
Fixes #56