feat(weather-recon): Phase 1 — curated stations + Directus weather schema (#184)#191
Merged
Conversation
Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
Adds scripts/build_stations.py (pick_station_rows/station_record pure functions, TDD'd) and the committed data/stations.csv it generates from NOAA's isd-history.csv: 187 stations covering 2001-09-09..12 (US 152, CA 17, MX 18). 7 of the original 175 curated ICAOs lacked ISD coverage for the window; resolved by checking data/isd-history.csv for a same-city substitute: - CYQB (Quebec City) -> substituted CWQB (same airport, alternate identifier, continuous 1955-2025 coverage) - KMDT (Harrisburg) -> substituted KCXY (Harrisburg Capital City, covers 2000-2003) - KHOU (Houston Hobby) -> dropped; KIAH already covers Houston in the curated set - KBTR (Baton Rouge), KFLL (Fort Lauderdale), KGPT (Gulfport-Biloxi), KRSW (SW Florida/Fort Myers) -> dropped; no same-city ISD row with 2001-09 coverage found (each has a pre-1998/pre-2000 gap and a post-2005/2006 row, but nothing spanning 2001) data/isd-history.csv (~3 MB NOAA cache) is gitignored, not committed. Co-Authored-By: Claude Fable 5 <[email protected]>
Task review caught that the KRSW drop was based on a wrong data read:
data/isd-history.csv row 722106-12835 "PAGE FIELD AIRPORT" (KFMY,
26.585,-81.861) covers 19430101-20250826, i.e. full 2001-09 coverage at
Fort Myers. The original grep for "FORT MYERS" only matched the retired
999999-12835 row whose name includes the city; the covering row's name
field ("PAGE FIELD AIRPORT") does not, so it was missed.
Adds KFMY to CURATED_ICAOS as the KRSW substitute (like CYQB->CWQB /
KMDT->KCXY), regenerates data/stations.csv (187 -> 188 stations: US 153,
CA 17, MX 18), and updates the stale curated-list header comment to the
real counts.
Co-Authored-By: Claude Fable 5 <[email protected]>
TDD implementation of load_stations() function that validates and parses stations.csv into typed dicts. Includes 10 test cases covering valid rows, type conversion, empty elevation handling, and comprehensive error validation (lat/lon ranges, country codes, required fields, duplicates). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01W179bqEPFP92a3JrsPkD5c
Implement DirectusClient with weather collections (weather_stations, weather_observations, weather_forecasts). Ported from flight_recon with three changes: new module docstring, weather-specific COLLECTIONS dict, and delete_all method (vs flight_date windowed delete_window). Co-Authored-By: Claude Fable 5 <[email protected]>
weather_forecasts has no station_id field; derive the _nnull delete filter from the collection's primary key instead. Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01W179bqEPFP92a3JrsPkD5c
Co-Authored-By: Claude Fable 5 <[email protected]>
|
✅ Playwright E2E — 1 passed · 0 failed · 0 flaky · 0 skipped |
This was referenced Jul 13, 2026
Merged
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.
Phase 1 of the Weather app (#184): new
packages/tools/weather-reconpackage — curated station reference table + the three Directus weather collections. Design spec:plans/weather-app-design.md.What's in here
data/stations.csv— 188 curated METAR stations (US 153 / CA 17 / MX 18, every state except Delaware) built from NOAAisd-history.csvbyscripts/build_stations.py; each row carriesisd_id(USAF-WBAN), the NCEI global-hourly join key Phase 2's observations flow needs. Curation notes: substituted CYQB→CWQB, KMDT→KCXY, KRSW→KFMY (no 2001-09 ISD coverage under the primary ICAO); dropped KHOU/KBTR/KFLL/KGPT.weather_recon/stations.py— validated CSV loader (test_committed_csv_is_validgates the committed file).weather_recon/directus.py— flight-recon's client ported verbatim + weatherCOLLECTIONS(weather_stations/weather_observations/weather_forecasts) +delete_allthat derives its filter from the collection PK.weather_recon/flow.py—load-weather-stationsPrefect flow: validate → ensure schema → idempotent reload.weather-recon-k8spool; worker Deployment + secret are infra-repo follow-ups).Verification
Follow-ups (Phase 2)
wfo/nws_zone/ghcn_idstation columns (added viaensure_collection's missing-field path), observations/radar/forecasts/almanac flows, fail-fast env check in_client,insert_manyfieldsparam → PK-derived, KMRY placeholder-USAF (999999-23259) join check.🤖 Generated with Claude Code
https://claude.ai/code/session_01W179bqEPFP92a3JrsPkD5c