input¶
- class InputScope(*values)[source]¶
The scope that input must be provided in
- tube = 'tube'¶
- process = 'process'¶
- pydantic model InputSpecification[source]¶
Specification of inputs to a noob tube.
Inputs can be supplied at different times and frequencies, as specified by scope:
tube: When instantiating the tube
process: Per call to
TubeRunner.process()
tube-scoped inputs may be used in a node’s param specification, and process-scoped inputs may be used as one of a node’s depends.
Inputs can be supplied at a “higher” scope and be accessed by lower scopes: e.g. input requested with a process scope can use input provided when instantiating the tube, if not provided to process but provided to the tube.
- Config:
extra: str = forbid
- Fields:
- field id: Annotated[str, AfterValidator(func=_is_identifier), AfterValidator(func=_not_reserved)] [Required]¶
- Constraints:
func = <function _not_reserved at 0x776e569c1620>
- field scope: InputScope = InputScope.tube¶
- field type_: Annotated[str, AfterValidator(func=_is_absolute_identifier)] [Required] (alias 'type')¶
- Constraints:
func = <function _is_absolute_identifier at 0x776e569c13a0>
- pydantic model InputCollection[source]¶
A collection of input specifications used during runtime, split by scope, to validate presence of and to combine inputs.
- field specs: dict[InputScope, dict[Annotated[str, AfterValidator(func=_is_identifier), AfterValidator(func=_not_reserved)], InputSpecification]] [Optional]¶
- add_input(scope: InputScope, input: dict) None[source]¶
Add some scope’s input to the input collection.
- filter_input(scope: InputScope, input: dict) dict[source]¶
filter input to only specified keys, emitting an ExtraInput warning if found.
- get(key: str, input: dict | None = None) Any[source]¶
Get a value from the inputs at any scope, if present
- get_node_params(params: dict) dict[source]¶
- get_node_params(params: list) list
Get tube-scoped params specified as inputs needed when instantiating a node
- model_post_init(context: Any, /) None¶
This function is meant to behave like a BaseModel method to initialize private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
- validate_input(scope: InputScope, input: dict) dict[source]¶
Check that the required inputs are present in one of several input dicts, and then filter to only specified input