测试修改
This commit is contained in:
@ -36,12 +36,12 @@ PIPELINE_AVAILABLE = True
|
||||
|
||||
|
||||
def _viz_training_spectra_csv_path(work_path: Path) -> Path:
|
||||
"""可视化光谱/统计及模型散点图使用的训练光谱表路径(与步骤5输出一致)。
|
||||
"""可视化光谱/统计及模型散点图使用的训练光谱表路径(与步骤6输出一致)。
|
||||
|
||||
注意:步骤5.5(水质指数计算)执行后会覆盖此文件为94维增强版本,
|
||||
因此下游步骤无需任何修改,直接读取此路径即可。
|
||||
"""
|
||||
return work_path / "5_training_spectra" / "training_spectra.csv"
|
||||
return work_path / "6_Spectral_Feature_Extraction" / "training_spectra.csv"
|
||||
|
||||
|
||||
def _viz_infer_wavelength_start_column(df: pd.DataFrame) -> Union[str, int]:
|
||||
@ -242,7 +242,7 @@ class VisualizationWorkerThread(QThread):
|
||||
if training_csv_path:
|
||||
training_csv = Path(training_csv_path)
|
||||
else:
|
||||
training_csv = wp / "5_training_spectra" / "training_spectra.csv"
|
||||
training_csv = wp / "6_Spectral_Feature_Extraction" / "training_spectra.csv"
|
||||
|
||||
if self.extra.get("gen_scatter"):
|
||||
if training_csv.is_file():
|
||||
@ -1697,9 +1697,9 @@ class Step12VizPanel(QWidget):
|
||||
}
|
||||
main_window = self.window()
|
||||
factory = getattr(main_window, '_panel_factory', None) if main_window else None
|
||||
step5_panel = factory.get_panel('step5_clean') if factory else None
|
||||
if step5_panel and getattr(step5_panel, 'output_file', None):
|
||||
_resolved_csv = step5_panel.output_file.get_path()
|
||||
step6_panel = factory.get_panel('step6_feature') if factory else None
|
||||
if step6_panel and getattr(step6_panel, 'output_file', None):
|
||||
_resolved_csv = step6_panel.output_file.get_path()
|
||||
if _resolved_csv:
|
||||
extra["training_csv_path"] = _resolved_csv
|
||||
step8_panel = factory.get_panel('step8_ml_train') if factory else None
|
||||
@ -1721,17 +1721,17 @@ class Step12VizPanel(QWidget):
|
||||
try:
|
||||
main_window = self.window()
|
||||
factory = getattr(main_window, '_panel_factory', None) if main_window else None
|
||||
step5_panel = factory.get_panel('step5_clean') if factory else None
|
||||
if step5_panel and getattr(step5_panel, 'output_file', None) and step5_panel.output_file.get_path():
|
||||
training_spectra_csv = Path(step5_panel.output_file.get_path())
|
||||
step6_panel = factory.get_panel('step6_feature') if factory else None
|
||||
if step6_panel and getattr(step6_panel, 'output_file', None) and step6_panel.output_file.get_path():
|
||||
training_spectra_csv = Path(step6_panel.output_file.get_path())
|
||||
else:
|
||||
training_spectra_csv = _viz_training_spectra_csv_path(work_path)
|
||||
if chart_type == 'scatter':
|
||||
if not training_spectra_csv.is_file():
|
||||
QMessageBox.warning(
|
||||
self, "警告",
|
||||
"未找到 5_training_spectra\\training_spectra.csv。\n"
|
||||
"请先执行步骤5(光谱特征提取)生成该文件。",
|
||||
"未找到 6_Spectral_Feature_Extraction\\training_spectra.csv。\n"
|
||||
"请先执行步骤6(光谱特征提取)生成该文件。",
|
||||
)
|
||||
return
|
||||
training_csv = training_spectra_csv
|
||||
@ -1751,8 +1751,8 @@ class Step12VizPanel(QWidget):
|
||||
if not training_spectra_csv.is_file():
|
||||
QMessageBox.warning(
|
||||
self, "警告",
|
||||
"未找到 5_training_spectra\\training_spectra.csv。\n"
|
||||
"光谱分析固定使用该文件,请先执行步骤5(光谱特征提取)。",
|
||||
"未找到 6_Spectral_Feature_Extraction\\training_spectra.csv。\n"
|
||||
"光谱分析固定使用该文件,请先执行步骤6(光谱特征提取)。",
|
||||
)
|
||||
return
|
||||
csv_file = training_spectra_csv
|
||||
@ -1775,8 +1775,8 @@ class Step12VizPanel(QWidget):
|
||||
if not training_spectra_csv.is_file():
|
||||
QMessageBox.warning(
|
||||
self, "警告",
|
||||
"未找到 5_training_spectra\\training_spectra.csv。\n"
|
||||
"统计分析固定使用该文件,请先执行步骤5(光谱特征提取)。",
|
||||
"未找到 6_Spectral_Feature_Extraction\\training_spectra.csv。\n"
|
||||
"统计分析固定使用该文件,请先执行步骤6(光谱特征提取)。",
|
||||
)
|
||||
return
|
||||
csv_file = training_spectra_csv
|
||||
|
||||
Reference in New Issue
Block a user