espnet3.contract.stages.check_requested_stages
Less than 1 minute
espnet3.contract.stages.check_requested_stages
espnet3.contract.stages.check_requested_stages(system_cls: type, requested: Sequence[str], provided: Mapping[str, Any]) → None
Raise unless each requested stage is declared and its config is given.
Checked once, right after resolve_stages expands the requested stage list, before any config is loaded.
- Parameters:
- system_cls – The system class the stages are requested against.
- requested – The resolved stage names (
resolve_stages’s output). - provided – Config role -> the config passed for that role (or
None/absent when not given), e.g.{"training": cfg, "inference": None}.
- Raises:StageContractError – A requested name is not declared, or a declared stage’s config role was not given.
Examples
>>> class ExampleSystem:
... stages = (StageSpec(name="train", config="training"),)
>>> check_requested_stages(ExampleSystem, ["train"], {"training": object()})