Repository navigation
fix(weather): metric visibility of 8000 m or more is VFR - #35
Merged
Merged
Conversation
A European report of 8000 m converted to 4.97 SM and landed in the FAA
MVFR band (3-5 SM), so `TEMPO 8000 SHRA` raised false "VFR -> MVFR" TAF
alerts in flyfun-weather. 5 SM is 8047 m; only the conversion made
8000 m marginal.
WeatherReport gains `visibility_unit` ("M" / "SM"), set by the parser and
carried through TAF group application and serialisation. A metric report
with visibility >= METRIC_VFR_VISIBILITY_M (8000) is VFR; SM reports keep
the FAA edge (5SM stays MVFR). The unit is needed because the parser fills
visibility_meters for SM reports too (5SM -> 8046 m). A report without a
unit falls back to the FAA rule.
For roznet/flyfun-weather#757
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MDyEuQSS1UNjQU4AViBbxf
2 tasks
Code ReviewReviewed the metric-visibility VFR fix: new |
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.
For roznet/flyfun-weather#757 (consumer PR: roznet/flyfun-weather, branch
claude/pensive-dijkstra-uqrgni).What
A European report of 8000 m converted to 4.97 SM and landed in the FAA MVFR band (3 to 5 SM). flyfun-weather raised false "TAF at ETA: VFR → MVFR" alerts from
TEMPO … 8000 SHRA. 5 SM is 8047 m: only the unit conversion made 8000 m marginal.WeatherReport.visibility_unit("M"/"SM", None when unknown) is new. The parser sets it, and TAF group application,_worse_ofandto_dict/from_dictcarry it through.WeatherAnalyzer.flight_category: a metric report with visibility ≥METRIC_VFR_VISIBILITY_M(8000, exported) is VFR. SM reports keep the FAA edge (5SM MVFR, 6SM VFR). A report with no unit falls back to the FAA rule, as before.visibility_meters" as metric. That doesn't work because the parser fills metres for SM reports too (5SM → 8046 m), so 5SM would have read VFR. The unit field is the fix for that.Additive, no breaking API change → minor bump to 0.22.0 via
/release. flyfun-weather's PR pinseuro-aip>=0.22.0.No Swift counterpart: RZFlight has no flight-category code (checked).
Verification
pytest tests/briefing/test_weather: 337 passed. 13 are new: METAR 8000/9999/7000/5000/4000, 5SM/6SM, no-unit fallback, dict round trip, the EGJB TAF with TEMPO 8000 → VFR, TEMPO 7000 → MVFR.test_aip_parser_parse_airports). It fails the same way on the branch without this change.🤖 Generated with Claude Code
https://claude.ai/code/session_01MDyEuQSS1UNjQU4AViBbxf
Generated by Claude Code