Add Transport Canada, build registry sources in parallel, and join them into one asset - #72
Draft
anchildress1 wants to merge 11 commits into
Draft
Conversation
- carry the two Government of Canada notices the open licence requires verbatim - record FAA public-domain provenance and unassessed third-party republished assets - LICENSE covers code only; release data carries its own conditions Generated-by: Claude Opus 5 <noreply@anthropic.com>
- parse the headerless latin1 CCARCS export against its declared column layout - derive transponder_code_hex from the 24-bit Mode S binary, populated for all 34,913 rows - expand marks to C- and vintage CF- registrations and drop owner mailing addresses - mirror the FAA build: same concat-with-latest-release dedup and output conventions Generated-by: Claude Opus 5 <noreply@anthropic.com>
- attribution is a licence condition and NOTICE must travel with release assets - a public licence travels to this project; a bilateral permission does not - non-commercial-only registries are incompatible with the MIT-licensed releases Generated-by: Claude Opus 5 <noreply@anthropic.com>
- reject Mode S fields that are not 24 binary digits; a short field zero-padded into a plausible address belonging to a different aircraft - check the "N rows selected." footer against the parsed row count and enforce a row floor, so an upstream short export fails instead of publishing as a smaller register - prefer ACTIVE_FLAG "A" parties but fall back to all: 1,932 Registered marks carry only "I" rows, and those are the MAIL_RECIPIENT, so filtering on "A" alone drops real owners - count distinct owner names rather than rows, fixing 154 marks labelled Co-owner in error - match the spool footer by pattern instead of a brittle ragged-row count Generated-by: Claude Opus 5 <noreply@anthropic.com>
- fall back to a single-day rebuild only on FileNotFoundError; a rate limit, schema change or truncated download previously took the same path and republished one day as the whole dataset, which the next run then read back as its base - move the monotonic download_date assert out of the try so corruption cannot select the destructive branch - walk back through releases like the ADS-B reader, so one missing optional asset does not strand the accumulation - authenticate release reads and verify downloaded asset size - read the previous CSV with keep_default_na=False so literal NA values round-trip - write the download atomically and reject non-zip responses Generated-by: Claude Opus 5 <noreply@anthropic.com>
- stop asserting US public-domain status for the derived FAA CSV; section 105 covers the government's own work, not this repository's derivative - name no licence instrument for Transport Canada, which does not publish one on the download page, rather than citing one that cannot be verified - state that MIT covers code only, resolving a contradiction with AGENTS.md - lead the source-eligibility rule with the bilateral-permission bar; Taiwan is OGDL licensed and excluded for that reason, not for commercial terms Generated-by: Claude Opus 5 <noreply@anthropic.com>
- publish street, city, postal code and care-of, which the FAA asset already carries as registrant_* for 99.7% of US registrants; dropping them here left one repository with two different postures on the same class of data - take the address from the single MAIL_RECIPIENT row rather than merging across parties, since a co-owned mark lists several people in different cities Generated-by: Claude Opus 5 <noreply@anthropic.com>
- registrant_* rather than owner_*, status rather than registration_status, so both registries describe the same concept with the same column name - registrant_zip_code carries the Canadian postal code: a union table needs one column per concept, not one per country's vocabulary - set source="TC", matching the discriminator the FAA frame already carries - raises the column names shared with the FAA frame from 9 to 21 Generated-by: Claude Opus 5 <noreply@anthropic.com>
- drop narrative rationale, restated rules and background a reader can grep for - one rule per line; the file is read by a model about to act, not by a person catching up - 151 lines to 85 Generated-by: Claude Opus 5 <noreply@anthropic.com>
- add a reusable registry-source workflow so every source runs in parallel rather than as a hand-written job; adding a registry becomes one matrix entry plus one script - add build_registry.py to align the per-source CSVs on the union of columns and emit a single table discriminated by the source column - reindex each frame to the union before concatenating, so a source missing a column yields an empty cell rather than a shifted row Generated-by: Claude Opus 5 <noreply@anthropic.com>
- replace the hand-written build-faa job with a matrixed call per source, faa required and tc tolerated, joined once every thread has finished - publish openairframes_registry_*.csv and keep openairframes_faa_*.csv during transition - validate the joined registry and NOTICE as required release files - report missing optional assets as a workflow annotation rather than a plain echo Generated-by: Claude Opus 5 <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.
Draft. 11 atomic commits, 8 files. Each commit builds and imports cleanly at its own SHA.
Two related changes that only make sense together: a second registry source, and a pipeline shape
that can actually hold more than one.
1. Transport Canada as a registry source
Picked against two constraints — the licence must permit redistribution in a public release, and the
data must carry ICAO 24-bit hex, since the ADS-B pipeline joins on it.
Most redistributable registries fail the second test: Australia, Brazil, Spain, Singapore and
Lithuania publish no hex at all. Taiwan, Estonia and Chile are cleared only by bilateral permission
granted to a different project, which does not travel here. Switzerland has hex but the same
bilateral problem. Transport Canada satisfies both — a standing public open licence, and 100% Mode
S coverage across all 34,913 records.
Two details worth a close look
CF-; everything else takes themodern
C-prefix. The split is 2,451 / 32,462.ACTIVE_FLAGdoes not mean "current owner". 1,932 currently-Registered marks carry onlyIparties, and those rows are the
MAIL_RECIPIENT. Filtering onAalone publishes registeredaircraft with no owner at all, so the code prefers
Aand falls back to all parties.Owner mailing addresses are published, matching the
registrant_*addresses the FAA asset alreadycarries for 99.7% of US registrants. Because CCARCS lists one row per party, the address comes from
the single
MAIL_RECIPIENTrow (exactly one per mark) rather than being merged across co-owners —a co-owned mark otherwise produces two streets and two cities with no way to pair them.
Column naming
Columns use the FAA vocabulary rather than CCARCS's own:
registrant_*notowner_*,statusnotregistration_status, andsource = "TC"matching the discriminator the FAA frame already carries.That raises the column names shared with the FAA frame from 9 to 21, which is what makes part 2
possible.
registrant_zip_codeholds the Canadian postal code — the name is the FAA's on purpose,because a union table wants one column per concept, not one per country's vocabulary.
2. Parallel source threads, joined once
Before this, every source was a hand-written job: adding one meant copy-pasting a job and editing
create-releasein four places, and each source published its own asset — so a consumer looking upone aircraft had to know which country's file to open, which is exactly what
openairframes_idandtransponder_code_hexexist to avoid.Adding a registry is now one matrix entry plus
src/create_daily_<source>_release.py. Thereusable workflow derives the script path from the source id and fails loudly if it is missing;
join-registrydiscovers sources by artifact pattern, so nothing downstream changes.required: true|falseper matrix entry replaces ad-hoccontinue-on-error, so whether a source canblock the release is declared in one place instead of inferred from several.
New asset
openairframes_registry_{start}_{end}.csv— every registry source on the union of columns,discriminated by
source. Each frame is reindexed to the union before concatenating, so a sourcemissing a column yields an empty cell rather than a shifted row.
openairframes_faa_*.csvkeeps publishing unchanged. It is documented in the README and peoplepull it, so it should be deprecated deliberately rather than disappearing under them.
Verified on real data
Joined the live 275 MB FAA asset with a live CCARCS build:
transponder_code_hex,registration_numberandopenairframes_idon both sourcesregistrant_nameFAA 96.7% / TC 100%)NOTICE
LICENSEcovers code; released data has separate terms. Canada requires two notices to reach theconsumer together, so
NOTICEcarries them and is validated as a required release file —shipping the data without it removes the permission that makes it redistributable. It also had to be
added to the
create-releasesparse checkout, which otherwise checks out only.github.NOTICEalso records that the derivedopenairframes_faa_*.csvis not itself a US government work:17 U.S.C. §105 disclaims copyright in the FAA's own data and says nothing about a derivative.
Also here
AGENTS.mdis trimmed to operative constraints only (151 lines to 85) and updated for the above.Happy to split any of this back out if you would rather take the pipeline change separately.
🤖 Generated with Claude Code