diff --git a/src/postprocessing/report_word.py b/src/postprocessing/report_word.py index 07485d0..0f677cf 100644 --- a/src/postprocessing/report_word.py +++ b/src/postprocessing/report_word.py @@ -1784,10 +1784,10 @@ class WaterQualityReportGenerator: doc.add_paragraph() # 表格和热力图之间的空行 # 2. 添加相关性热力图(放在表格下方)—— 仅 ML 模式 + heatmap_path = vis_dir / "correlation_heatmap.png" if getattr(self, '_pipeline_mode', 'ml') == 'ml': h3 = doc.add_heading("4.2 水质参数相关性分析", level=2) self._style_heading(h3, level=2) - heatmap_path = vis_dir / "correlation_heatmap.png" figure_num = start_figure_num if heatmap_path.exists(): try: @@ -1827,7 +1827,9 @@ class WaterQualityReportGenerator: pass doc.add_page_break() - return start_figure_num + (1 if heatmap_path.exists() else 0) + heatmap_added = 1 if (getattr(self, '_pipeline_mode', 'ml') == 'ml' + and heatmap_path.exists()) else 0 + return start_figure_num + heatmap_added def _add_physical_inversion_section( self,