From 26674cf2b731fb3009e122746a9ecc5ef126451b Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Mon, 6 Apr 2026 12:47:52 +0800 Subject: [PATCH] Clarify NMC labels as regional observations --- src/data_collection/nmc_sources.py | 3 ++- tests/test_country_networks.py | 2 +- tests/test_nmc_sources.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/data_collection/nmc_sources.py b/src/data_collection/nmc_sources.py index 8b7dec8e..131a7e5e 100644 --- a/src/data_collection/nmc_sources.py +++ b/src/data_collection/nmc_sources.py @@ -168,7 +168,8 @@ class NmcSourceMixin: city_meta = self.CITY_REGISTRY.get(str(city or "").strip().lower()) or {} return [ { - "name": f"{meta.get('region_label') or current.get('station_name')} (NMC)", + "name": f"{meta.get('region_label') or current.get('station_name')}区域实况 (NMC)", + "station_label": f"{meta.get('region_label') or current.get('station_name')}区域实况 (NMC)", "lat": city_meta.get("lat"), "lon": city_meta.get("lon"), "temp": current.get("current", {}).get("temp"), diff --git a/tests/test_country_networks.py b/tests/test_country_networks.py index f5b0725d..3686cef1 100644 --- a/tests/test_country_networks.py +++ b/tests/test_country_networks.py @@ -62,7 +62,7 @@ def test_china_provider_prefers_nmc_rows_when_available(): }, "nmc_official_nearby": [ { - "name": "浦东 (NMC)", + "name": "浦东区域实况 (NMC)", "icao": "atcMf", "lat": 31.14, "lon": 121.80, diff --git a/tests/test_nmc_sources.py b/tests/test_nmc_sources.py index c8382180..d43bd3d1 100644 --- a/tests/test_nmc_sources.py +++ b/tests/test_nmc_sources.py @@ -95,5 +95,6 @@ def test_fetch_nmc_official_nearby_returns_normalized_row(): assert len(rows) == 1 assert rows[0]["source"] == "nmc" assert rows[0]["temp"] == 17.9 - assert rows[0]["name"] == "浦东 (NMC)" + assert rows[0]["name"] == "浦东区域实况 (NMC)" + assert rows[0]["station_label"] == "浦东区域实况 (NMC)" assert rows[0]["lat"] == 31.1434