fix: 修复 Step8 模型生成路径错误及特征分离未过滤坐标列导致的 0 模型 Bug
- view 层 Step8View.update_work_directory 不再生成 <work_dir>/indices/<basename>_indices.csv,改为生成标准的 <work_dir>/8_Modeling/ 模型存放目录;FileSelectWidget 标签与文件过滤器同步调整为目录语义(输出模型目录 / All Files (*.*)),消除'保存目录被存成 csv 文件'导致的 train_models 跳过判定。
This commit is contained in:
@ -141,10 +141,10 @@ class Step8View(BaseView):
|
||||
|
||||
# 输出文件路径
|
||||
self.output_path = FileSelectWidget(
|
||||
"输出文件:",
|
||||
"CSV Files (*.csv);;All Files (*.*)",
|
||||
"输出模型目录:",
|
||||
"All Files (*.*)",
|
||||
)
|
||||
self.output_path.line_edit.setPlaceholderText("自动生成,或手动指定输出文件路径...")
|
||||
self.output_path.line_edit.setPlaceholderText("自动生成模型存放目录...")
|
||||
layout.addWidget(self.output_path)
|
||||
|
||||
# 启用步骤
|
||||
@ -301,17 +301,11 @@ class Step8View(BaseView):
|
||||
step6_training_csv = os.path.join(step6_dir, "training_spectra.csv").replace("\\", "/")
|
||||
if not self.training_csv_file.get_path():
|
||||
self.training_csv_file.set_path(step6_training_csv)
|
||||
# 自动填输出路径
|
||||
indices_dir = _resolve_subdir(work_dir, "indices")
|
||||
os.makedirs(indices_dir, exist_ok=True)
|
||||
training_csv = self.training_csv_file.get_path()
|
||||
if training_csv:
|
||||
basename = os.path.splitext(os.path.basename(training_csv))[0]
|
||||
output_file = f"{basename}_indices.csv"
|
||||
else:
|
||||
output_file = "training_spectra_indices.csv"
|
||||
output_path = os.path.join(indices_dir, output_file).replace("\\", "/")
|
||||
self.output_path.set_path(output_path)
|
||||
|
||||
# ⬇️ 修复:生成标准的输出目录路径
|
||||
models_dir = _resolve_subdir(work_dir, "8_Modeling")
|
||||
os.makedirs(models_dir, exist_ok=True)
|
||||
self.output_path.set_path(models_dir)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# 执行入口
|
||||
|
||||
Reference in New Issue
Block a user