From 27010d5fb3c6b4c6a92a231413e399ce4fac5b38 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Sun, 10 May 2026 17:59:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=20KMA=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=BA=90=EF=BC=9A=E5=B7=B2=E8=A2=AB=E6=9B=B4=E7=B2=BE=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=20AMOS=20=E8=B7=91=E9=81=93=E7=BA=A7=E4=BC=A0?= =?UTF-8?q?=E6=84=9F=E5=99=A8=E5=8F=96=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - weather_sources.py:移除 KmaStationSourceMixin 导入和继承 - 移除 _attach_korea_official_nearby() 函数 - 移除 kma_cache 初始化代码 - 首尔/釜山现在使用 AMOS 跑道传感器替代 KMA 地面站 - kma_station_sources.py 保留为参考文件 Replaced-by: AMOS (global.amo.go.kr) runway-level sensor data --- src/data_collection/weather_sources.py | 29 ++------------------------ 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/data_collection/weather_sources.py b/src/data_collection/weather_sources.py index c7132797..51a90a64 100644 --- a/src/data_collection/weather_sources.py +++ b/src/data_collection/weather_sources.py @@ -10,7 +10,6 @@ from src.data_collection.open_meteo_cache import OpenMeteoCacheMixin from src.data_collection.settlement_sources import SettlementSourceMixin from src.data_collection.metar_sources import MetarSourceMixin from src.data_collection.mgm_sources import MgmSourceMixin -from src.data_collection.kma_station_sources import KmaStationSourceMixin from src.data_collection.jma_amedas_sources import JmaAmedasSourceMixin from src.data_collection.russia_station_sources import RussiaStationSourceMixin from src.data_collection.nmc_sources import NmcSourceMixin @@ -18,7 +17,7 @@ from src.data_collection.nws_open_meteo_sources import NwsOpenMeteoSourceMixin from src.data_collection.amos_station_sources import AmosStationSourceMixin -class WeatherDataCollector(OpenMeteoCacheMixin, SettlementSourceMixin, MetarSourceMixin, MgmSourceMixin, KmaStationSourceMixin, JmaAmedasSourceMixin, RussiaStationSourceMixin, NmcSourceMixin, NwsOpenMeteoSourceMixin, AmosStationSourceMixin): +class WeatherDataCollector(OpenMeteoCacheMixin, SettlementSourceMixin, MetarSourceMixin, MgmSourceMixin, JmaAmedasSourceMixin, RussiaStationSourceMixin, NmcSourceMixin, NwsOpenMeteoSourceMixin, AmosStationSourceMixin): """ Multi-source weather data collector @@ -28,7 +27,7 @@ class WeatherDataCollector(OpenMeteoCacheMixin, SettlementSourceMixin, MetarSour - AMOS (Korean runway-level airport sensors — RKSI, RKPK) - NWS (US National Weather Service) - MGM (Turkish Meteorological Service) - - KMA / JMA / NMC / HKO / CWA (country official networks) + - JMA / NMC / HKO / CWA (country official networks) - Polymarket (weather derivative markets) """ @@ -209,11 +208,6 @@ class WeatherDataCollector(OpenMeteoCacheMixin, SettlementSourceMixin, MetarSour ) self._jma_cache: Dict[str, Dict] = {} self._jma_cache_lock = threading.Lock() - self.kma_cache_ttl_sec = int( - os.getenv("KMA_STATION_CACHE_TTL_SEC", "300") - ) - self._kma_cache: Dict[str, Dict] = {} - self._kma_cache_lock = threading.Lock() self.ru_station_cache_ttl_sec = int( os.getenv("RU_STATION_CACHE_TTL_SEC", "300") ) @@ -740,8 +734,6 @@ class WeatherDataCollector(OpenMeteoCacheMixin, SettlementSourceMixin, MetarSour normalized = str(city or "").strip().lower() with self._jma_cache_lock: self._jma_cache.pop(f"{normalized}:{use_fahrenheit}", None) - with self._kma_cache_lock: - self._kma_cache.pop(f"{normalized}:{use_fahrenheit}", None) with self._nmc_cache_lock: self._nmc_cache.pop(f"{normalized}:{use_fahrenheit}", None) with self._ru_station_cache_lock: @@ -880,21 +872,6 @@ class WeatherDataCollector(OpenMeteoCacheMixin, SettlementSourceMixin, MetarSour results["mgm_nearby"] = official_rows results["nearby_source"] = "jma" - def _attach_korea_official_nearby( - self, results: Dict, city_lower: str, use_fahrenheit: bool - ) -> None: - if city_lower not in {"busan", "seoul"}: - return - official_rows = self.fetch_kma_official_nearby( - city_lower, use_fahrenheit=use_fahrenheit - ) - if not official_rows: - return - results["kma_official_nearby"] = official_rows - if "mgm_nearby" not in results: - results["mgm_nearby"] = official_rows - results["nearby_source"] = "kma" - def _attach_korean_amos_data( self, results: Dict, city_lower: str, use_fahrenheit: bool ) -> None: @@ -1037,7 +1014,6 @@ class WeatherDataCollector(OpenMeteoCacheMixin, SettlementSourceMixin, MetarSour if include_nearby: self._attach_china_official_nearby(results, city_lower, use_fahrenheit) self._attach_japan_official_nearby(results, city_lower, use_fahrenheit) - self._attach_korea_official_nearby(results, city_lower, use_fahrenheit) self._attach_korean_amos_data(results, city_lower, use_fahrenheit) self._attach_russia_official_nearby(results, city_lower, use_fahrenheit) if city_lower == "warsaw": @@ -1080,7 +1056,6 @@ class WeatherDataCollector(OpenMeteoCacheMixin, SettlementSourceMixin, MetarSour if include_nearby: self._attach_china_official_nearby(results, city_lower, use_fahrenheit) self._attach_japan_official_nearby(results, city_lower, use_fahrenheit) - self._attach_korea_official_nearby(results, city_lower, use_fahrenheit) self._attach_korean_amos_data(results, city_lower, use_fahrenheit) self._attach_russia_official_nearby(results, city_lower, use_fahrenheit) if city_lower == "warsaw":