Compile a PipelineSpec into an ordered list of Process instances.
Source code in cltk/pipeline/compiler.py
| def compile_processes(spec: PipelineSpec) -> list[Any]:
"""Compile a PipelineSpec into an ordered list of Process instances."""
steps = _resolve_steps(spec)
processes: list[Any] = []
for step in steps:
if not step.enabled:
continue
process_cls = ProcessRegistry.get_process(step.id)
config = dict(step.config)
if spec.language and "glottolog_id" not in config:
config["glottolog_id"] = spec.language
if spec.step_overrides and step.id in spec.step_overrides:
config.update(spec.step_overrides[step.id])
processes.append(process_cls(**config))
return processes
|