From 717106eec6d4a8fffd44ae548c83d6fba249859c Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Sun, 19 Apr 2026 14:25:38 +0800 Subject: [PATCH] Anchor Paris weather data to Le Bourget --- frontend/lib/dashboard-official-sources.ts | 4 ++-- src/data_collection/city_registry.py | 16 ++++++++++------ src/data_collection/weather_sources.py | 2 +- tests/test_country_networks.py | 12 ++++++++++++ 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/frontend/lib/dashboard-official-sources.ts b/frontend/lib/dashboard-official-sources.ts index 150668cc..af73d989 100644 --- a/frontend/lib/dashboard-official-sources.ts +++ b/frontend/lib/dashboard-official-sources.ts @@ -351,8 +351,8 @@ const CITY_SPECIFIC_SOURCES: Record = { kind: "agency", }, { - label: "LFPG METAR", - href: "https://aviationweather.gov/data/metar/?id=LFPG&decoded=1&taf=1", + label: "LFPB METAR", + href: "https://aviationweather.gov/data/metar/?id=LFPB&decoded=1&taf=1", kind: "metar", }, ], diff --git a/src/data_collection/city_registry.py b/src/data_collection/city_registry.py index 3712c232..18181cec 100644 --- a/src/data_collection/city_registry.py +++ b/src/data_collection/city_registry.py @@ -68,17 +68,21 @@ CITY_REGISTRY = { }, "paris": { "name": "Paris", - "lat": 49.0097, - "lon": 2.5480, - "icao": "LFPG", + "lat": 48.9694, + "lon": 2.4414, + "icao": "LFPB", + "settlement_source": "metar", + "settlement_station_code": "LFPB", + "settlement_station_label": "Paris-Le Bourget Airport METAR", + "settlement_url": "https://www.wunderground.com/history/daily/fr/bonneuil-en-france/LFPB", "tz_offset": 3600, "use_fahrenheit": False, "is_major": True, "risk_level": "medium", "risk_emoji": "🟡", - "airport_name": "Charles de Gaulle 机场", - "distance_km": 25.2, - "warning": "城市热岛效应:市区比机场偏暖1-2°C。", + "airport_name": "Paris-Le Bourget 机场", + "distance_km": 12.0, + "warning": "巴黎市场现按 Le Bourget 机场 METAR / LFPB 历史记录锚定;市区热岛与机场北侧低云可能造成偏差。", }, "seoul": { "name": "Seoul", diff --git a/src/data_collection/weather_sources.py b/src/data_collection/weather_sources.py index 6fde2555..9f347f5b 100644 --- a/src/data_collection/weather_sources.py +++ b/src/data_collection/weather_sources.py @@ -46,7 +46,7 @@ class WeatherDataCollector(OpenMeteoCacheMixin, SettlementSourceMixin, MetarSour "austin": ["KAUS", "KEDC", "KSAT"], "houston": ["KHOU", "KIAH", "KSGR", "KCXO"], "mexico city": ["MMMX", "MMSM", "MMTO"], - "paris": ["LFPG", "LFPO", "LFPB"], + "paris": ["LFPB", "LFPG", "LFPO"], "seoul": ["RKSI", "RKSS"], "busan": ["RKPK", "RKSS"], "hong kong": ["VHHH", "VMMC", "ZGSZ"], diff --git a/tests/test_country_networks.py b/tests/test_country_networks.py index cef3153f..0dbde8d2 100644 --- a/tests/test_country_networks.py +++ b/tests/test_country_networks.py @@ -26,6 +26,18 @@ def test_new_south_asia_city_registry_entries_are_wired(): assert CITIES["masroor air base"]["settlement_source"] == "metar" +def test_paris_registry_uses_le_bourget_anchor(): + paris = CITY_REGISTRY["paris"] + + assert paris["icao"] == "LFPB" + assert paris["settlement_source"] == "metar" + assert paris["settlement_station_code"] == "LFPB" + assert "bonneuil-en-france/LFPB" in paris["settlement_url"] + assert CITIES["paris"]["lat"] == paris["lat"] + assert CITIES["paris"]["settlement_source"] == "metar" + assert _DummyMetarSource.CITY_TO_ICAO["paris"] == "LFPB" + + def test_turkey_metar_uses_fast_cache_ttl(): source = _DummyMetarSource()