Repository navigation
fix(briefing): locate FPL field 13 by shape in Python, as Swift does - #29
Merged
Merged
Conversation
parse_icao_fpl counted fields to find field 13. With fields 9 and 10
split and no field 18/19 (7 fields), it read field 10 ("S/C") as field
13, shifting departure, route and destination by one slot while still
returning a plan. Port the Swift rule from ICAOFlightPlanParser.swift:
first field from field 9 on matching ICAO+HHMM (ZZZZ included), any slot
between field 9 and it is field 10, fall back to index 3.
Tests cover the split 9/10 case, split + field 19, joined vs split
agreement, ZZZZ, and the Swift test cases' departure/route/destination.
Closes #26
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017wHeKu6ZBSduENF1cjtNTe
Code ReviewReviewed the Python port of Swift's field-13 shape match in |
roznet
added a commit
that referenced
this pull request
Oct 6, 2026
a495e8c made _row_to_notam read the API's Garmin semicircles, but the test rows still carried decimal degrees, so test_coordinates had failed on main since. The full suite is green again (1071 passed). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Ports the Swift field-13 shape match (
ICAOFlightPlanParser.swift) toparse_icao_fpl, fixing the split 9/10 + no 18/19 misparse.Closes #26
Owner's brief: #26 Python FPL parser: find field 13 by shape
Kind: 100% parser behaviour (Python only, no API change)
In one line:
parse_icao_fplnow finds field 13 by its ICAO+HHMM shape, the same regex and rule asICAOFlightPlanParser.swift, so an FPL with fields 9 and 10 split and no field 18/19 no longer shifts departure/route/destination by one slot.What changes for consumers
-C172/L -S/C -EGKA0900 ...with nothing after field 16) now parse correctly instead of departure "S/C". All other well-formed plans give the same output as before. Gets it once it bumps itseuro-aippin.parse_icao_fplcaller in consumers.md).Decisions I made for you
([0-1]\d|2[0-3])[0-5]\d), not the looser[A-Z]{4}\d{4}the issue text quotes. Parity over the issue's wording. Easy to flip.How it could go wrong
-EGLL99) plus a field 16 with no alternate (-EGSS0025): field 16 has field 13's shape and is taken as departure. Old Python code would have used slot 3. Same behaviour as Swift today; recorded as a gotcha in the design doc. You'd notice it as departure == destination-like airport and no route.How we know it works
test_icao_fpl.py68 passed (12 new); the split-9/10 test fails on the old code and passes now. Full suite: 1057 passed, 3 failed, all 3 also failing onorigin/main(test_autorouter_notam coordinates, METAR flight-category IFR, aip_parser parse_airports).Worth making sure you understand
Parity: Python now matches Swift; Swift design doc notes Python uses the same regex.
Design docs:
briefing_models.md"Locating Field 13" rewritten (dropped "Python still uses the count", added the field-16 gotcha); one line inswift_briefing.mdGotchas.Release: patch, euro_aip 0.19.1 → 0.19.2 (pip only). No DB rebuild, no SPM tag.
Consumer follow-up: flyfun-weather: bump pin to
>=0.19.2after release.Pick up on a Mac: nothing (Python-only).
Follow-ups noticed (not done): restrict the field-13 scan to slots 3..4 on both sides (above); 3 pre-existing test failures on main.
🤖 Generated with Claude Code
https://claude.ai/code/session_017wHeKu6ZBSduENF1cjtNTe
Generated by Claude Code