From 174042515279b4daca4e487dbb7a8e4825408801 Mon Sep 17 00:00:00 2001 From: duxin Date: Thu, 9 Jul 2026 11:17:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=8A=A5=E5=91=8A=E6=B0=B4=E8=89=B2?= =?UTF-8?q?=E6=8C=87=E6=95=B0=E6=A8=A1=E5=BC=8F=20stats=5Fdata=20=E8=A1=A5?= =?UTF-8?q?=E5=85=A8=E7=BC=BA=E5=A4=B1=E7=9A=84=E7=BB=9F=E8=AE=A1=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 水色指数模式 stats_data 只复制了 参数/点位数, 缺少 最小值/最大值/平均值/标准差 → _analyze_statistics 访问时 KeyError: '最小值' --- src/postprocessing/report_word.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/postprocessing/report_word.py b/src/postprocessing/report_word.py index 0c2391f..07485d0 100644 --- a/src/postprocessing/report_word.py +++ b/src/postprocessing/report_word.py @@ -1724,7 +1724,11 @@ class WaterQualityReportGenerator: row_cells = table.add_row().cells for j, (col_name, hdr_name) in enumerate(header_map.items()): row_cells[j].text = str(row_dict.get(col_name, '')) - stats_data = [{'参数': r['参数'], '点位数': r['数量']} for r in stats_rows] + stats_data = [{ + '参数': r['参数'], '点位数': r['数量'], + '最小值': str(r['最小值']), '最大值': str(r['最大值']), + '平均值': str(r['平均值']), '标准差': str(r['标准差']), + } for r in stats_rows] else: # ML 模式:逐列统计 stats_data = []