Skip to content

feat: Add explicit runway visual range unit to parsed METAR runway data#125

Merged
mivek merged 2 commits intomainfrom
copilot/implement-pr-789-changes
Apr 21, 2026
Merged

feat: Add explicit runway visual range unit to parsed METAR runway data#125
mivek merged 2 commits intomainfrom
copilot/implement-pr-789-changes

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 21, 2026

This ports the upstream runway-visibility unit change into the Python parser so runway visual range no longer loses unit semantics. FT runway ranges are now represented explicitly instead of being implied from raw token format.

  • Model update: explicit runway unit

    • Added LengthUnit enum (METERS, FEET) in metar_taf_parser.model.enum.
    • Extended RunwayInfo with a new unit field and included it in object representation.
  • Parser update: deterministic unit assignment

    • Updated runway parsing paths (Rxx/#### and Rxx/####V####) to set:
      • LengthUnit.FEET when token includes FT
      • LengthUnit.METERS otherwise
    • Centralized unit decoding in a small helper to keep both parse branches consistent.
  • Coverage update: runway unit expectations

    • Extended command- and parser-level tests to assert unit values for both meter-based and FT runway visual range inputs.
# before: unit was implicit/absent
# after: unit is explicit on RunwayInfo
runway.unit = LengthUnit.FEET if token_suffix == "FT" else LengthUnit.METERS

@sonarqubecloud
Copy link
Copy Markdown

@mivek mivek changed the title Add explicit runway visual range unit to parsed METAR runway data feat: Add explicit runway visual range unit to parsed METAR runway data Apr 21, 2026
@mivek mivek merged commit 6f0d08a into main Apr 21, 2026
9 of 10 checks passed
@mivek mivek deleted the copilot/implement-pr-789-changes branch April 21, 2026 09:11
@github-actions
Copy link
Copy Markdown

🎉 This PR is included in version 1.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants