cursus.steps.interfaces¶
Step Interface Loader
Loads unified .step.yaml files and emits a single validated StepInterface object.
This is the single entry point for all step interface data. The former per-step
steps/specs/ and steps/contracts/ folders are gone — the .step.yaml here is the
sole source, and its contract/spec sections are views onto one aligned object.
For backward compatibility, load_step_interface still returns a 2-tuple that
destructures as (contract, spec):
contractis the StepInterface’s ContractSection — a drop-in for the legacy ScriptContract/StepContract (exposesexpected_input_pathsetc.).specis the StepInterface itself — a drop-in for the legacy StepSpecification (exposesdependencies/outputs/get_output_by_name_or_alias/script_contract/…).
Both elements are views onto the same validated StepInterface. Use
load_interface(...) to get the StepInterface directly.
- Usage:
from cursus.steps.interfaces import load_step_interface, load_interface
contract, spec = load_step_interface(“TabularPreprocessing”) iface = load_interface(“CradleDataLoading”, job_type=”calibration”)
- register_pack_interface_dir(interfaces_dir)[source]¶
Register an external step-pack
interfaces/dir for interface resolution (add-only).Searched AFTER the package dir, so package interfaces are never shadowed unless a pack deliberately ships the same name. Registering a NEW dir invalidates the interface cache so a pack step’s interface is picked up. Idempotent;
None/missing dirs are ignored.
- load_interface(step_name, job_type=None)[source]¶
Load a step’s unified interface from YAML as a single StepInterface.
- Parameters:
- Returns:
Validated StepInterface (variant-resolved when job_type is given).
- Return type:
- load_step_interface(step_name, job_type=None)[source]¶
Backward-compatible loader returning a
(contract, spec)tuple.Both elements are views onto one validated StepInterface: -
[0]= the ContractSection (ScriptContract/StepContract drop-in) -[1]= the StepInterface (StepSpecification drop-in)New code should prefer
load_interface().
- list_available_interfaces()[source]¶
List all available step interface names (package + registered packs).
- clear_interface_cache()[source]¶
Clear the in-process interface cache.
Interfaces are cached by
step_name:job_typefor the life of the process. This helper lets tests and dev hot-reload pick up edited.step.yamlfiles without a restart (long-running processes otherwise serve stale interface data).
Modules
Per-step connection / I-O view (FZ 31e1d3d / 31e1d3b1 follow-up). |