diff --git a/src/core/pipeline/runner.py b/src/core/pipeline/runner.py index 4999b71..6b46269 100644 --- a/src/core/pipeline/runner.py +++ b/src/core/pipeline/runner.py @@ -67,8 +67,18 @@ PIPELINE_STEPS: List[StepSpec] = [ ), StepSpec( step_id="step5", method_name="step5_extract_training_spectra", - requires=["deglint_img_path", "csv_path", "boundary_path", "glint_mask_path"], + requires=["deglint_img_path", "processed_csv_path", "csv_path", "boundary_path", "glint_mask_path"], produces=["training_csv_path"], + # processed_csv_path(step4 产物) 才是 step5 真正需要的主路径, + # 通过 parameter_map 显式映射到形参 csv_path。 + # raw csv_path 也保留在 requires 中以备 user_config 覆盖, + # 但用占位名 _raw_csv_ignored 注入,落到 step5 形参列表末尾的 **kwargs 兜底。 + # 这样可以避免 L2 顺序注入中"后注入的 csv_path=None 覆盖前面的 processed_csv_path"的冲突。 + parameter_map={ + "processed_csv_path": "csv_path", + "csv_path": "_raw_csv_ignored", + }, + skip_when_missing=False, description="实测样本点光谱提取", ), StepSpec( @@ -157,9 +167,10 @@ class PipelineRunner: missing = [k for k in spec.requires if not ctx.get(k)] if missing: ctx.status[spec.step_id] = "skipped" - ctx.append_log( - f"[RUNNER] {spec.step_id} 缺少入参: {missing},跳过" - ) + reason = f"缺少必要的上下文参数,自动跳过: {missing}" + ctx.append_log(f"[RUNNER] {spec.step_id} {reason}") + if hasattr(self.pipeline, "_notify"): + self.pipeline._notify(spec.description, "skipped", reason) continue self._invoke(spec, ctx) ctx.pipeline_end_time = time.time()