DynamicInputs
Dynamic input specification that allows tasks to have a variable number of input ports.
This class enables tasks to accept a dynamic number of input resources that can be added or removed at runtime. All input resources are aggregated into a single ResourceList that is passed to the task under the name specified by SPEC_NAME ('source').
Dynamic inputs are useful for tasks that need to process an arbitrary number of similar resources, such as merging multiple files or combining multiple datasets.
Attributes: SPEC_NAME: The name of the input parameter passed to the task ('source'). This is the key under which the aggregated ResourceList will be available. additionnal_port_spec: Optional specification that defines the type and constraints for dynamically created input ports. If None, defaults to accepting any Resource type.
Example: ```python # Define dynamic inputs that accept Table resources inputs = DynamicInputs( additionnal_port_spec=InputSpec(Table, human_name="Input table") )
# In the task's run method:
def run(self, params: ConfigParams, inputs: InputsDTO) -> OutputsDTO:
# Access all inputs as a ResourceList
sources: ResourceList = inputs['source']
# Process each table
for table in sources:
# Process table...
```
additionnal_port_spec: gws_core.io.io_spec.InputSpec | Nonedict[str, gws_core.io.io_spec.InputSpec] | Nonegws_core.io.io_spec.InputSpec | NoneCheck and convert input to TaskInputs
dictTaskInputsdictInputSpecgws_core.io.io_spec.IOSpec | NonestrIOSpecdictLiteralstrbooldict | NoneIOSpecsDTOdictdict | NoneDynamicInputs