Skip to content

fix(weather): VRB wind with a gust takes the gust as worst-case crosswind - #36

Merged
roznet merged 1 commit into
mainfrom
claude/funny-goldberg-xrplfy
Oct 11, 2026
Merged

roznet merged 1 commit into
mainfrom
claude/funny-goldberg-xrplfy

Conversation

@roznet

@roznet roznet commented Oct 10, 2026

Copy link
Copy Markdown
Owner

What & why

WeatherAnalyzer.wind_components gave a variable wind with no direction a max_crosswind equal to its mean speed, ignoring the gust: VRB05G20 reported a worst case of 5 kt. With no direction, the gust can come from abeam as easily as the mean wind, so the worst case is now the gust (20). Directional winds are unchanged.

Found while building the runway + wind widget in roznet/flyfun-weather#758, which shows max_crosswind for VRB winds. The flyfun-weather side does not depend on this fix: it builds a WeatherReport and calls the existing API, so it works on 0.21.0 and picks this up once released and the pin moves.

Library vs app: this is the only change that belongs in euro_aip. The issue's optional free function wind_components(dir, speed, gust, …) was not added, because building a minimal WeatherReport already covers it, and adding it would force a release before the app could ship. The picture model, the advisory tiers and the drawing rules are app-specific and stay in flyfun-weather.

  • No Swift counterpart: RZFlight has no wind-components code, so there's no parity change.
  • designs/briefing_weather.md updated (worst-case row and edge-case note).
  • Patch-level fix. No version bump here; /release does that.

Testing

  • pytest tests/briefing/test_weather -q: 326 passed, including the new test_variable_wind_no_direction_with_gust.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QCbHFQiRxP8H8J4NPqz2AB


Generated by Claude Code

…wind

A variable wind has no direction, so its gust can come from abeam just as
the mean wind can. wind_components gave VRB05G20 a max_crosswind of 5;
it is now 20. Directional winds are unchanged.

Found while building the runway + wind widget in flyfun-weather
(roznet/flyfun-weather#758), which shows max_crosswind for VRB winds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QCbHFQiRxP8H8J4NPqz2AB
@claude

claude Bot commented Oct 10, 2026

Copy link
Copy Markdown

Code Review

Reviewed the VRB-with-gust change to WeatherAnalyzer.wind_components, with its test and design-doc update. The fix itself is correct and small. Directional winds are unchanged, and the Swift side has no counterpart.

Important

  • euro_aip/euro_aip/briefing/weather/models.py:103 — within_limits() ignores max_crosswind. It reads gust_crosswind, which is still None for VRB winds, and falls back to crosswind (the mean speed). So VRB05G20 now reports max_crosswind=20, but within_limits(max_crosswind_kt=15) still returns True. designs/briefing_weather.md says it "checks all components including gusts", so the new worst case is not enforced. Either set gust_crosswind (and gust_headwind) for the VRB branch, or make within_limits use max_crosswind. Add a test for it. Callers that use within_limits (flyfun-weather) would otherwise get a "within limits" result for a gusty VRB wind.

Minor

  • euro_aip/euro_aip/briefing/weather/analysis.py:196 — crosswind stays at the mean speed while max_crosswind is the gust. That is fine, but the design table for crosswind and gust_crosswind should say that VRB leaves gust_crosswind as None.

@roznet
roznet merged commit 29c2aec into main Oct 11, 2026
2 checks passed
@roznet
roznet deleted the claude/funny-goldberg-xrplfy branch October 11, 2026 13:58
roznet added a commit that referenced this pull request Oct 11, 2026
within_limits() read gust_crosswind (None for VRB) or the mean-direction
crosswind, so VRB05G20 reported max_crosswind=20 yet passed a 15 kt limit.
It now also checks max_crosswind, which covers VRB gusts and variable
sectors (270V240-300 on runway 27 checks 7.5 kt, not 0). Design doc notes
that VRB leaves gust_crosswind as None.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

2 participants