kiara.examples.example_controller¶
ExampleController
¶
pipeline_inputs_changed(self, event)
¶
Method to override if the implementing controller needs to react to events where one or several pipeline inputs have changed.
Note
Whenever pipeline inputs change, the connected step inputs also change and an (extra) event will be fired for those. Which means
you can choose to only implement the step_inputs_changed
method if you want to. This behaviour might change in the future.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event |
PipelineInputEvent |
the pipeline input event |
required |
Source code in kiara/examples/example_controller.py
def pipeline_inputs_changed(self, event: PipelineInputEvent):
print(f"Pipeline inputs changed: {event.updated_pipeline_inputs}")
print(f" -> pipeline status: {self.pipeline_status.name}")
pipeline_outputs_changed(self, event)
¶
Method to override if the implementing controller needs to react to events where one or several pipeline outputs have changed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event |
PipelineOutputEvent |
the pipeline output event |
required |
Source code in kiara/examples/example_controller.py
def pipeline_outputs_changed(self, event: PipelineOutputEvent):
print(f"Pipeline outputs changed: {event.updated_pipeline_outputs}")
print(f" -> pipeline status: {self.pipeline_status.name}")
step_inputs_changed(self, event)
¶
Method to override if the implementing controller needs to react to events where one or several step inputs have changed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event |
StepInputEvent |
the step input event |
required |
Source code in kiara/examples/example_controller.py
def step_inputs_changed(self, event: StepInputEvent):
print("Step inputs changed, new values:")
for step_id, input_names in event.updated_step_inputs.items():
print(f" - step '{step_id}':")
for name in input_names:
new_value = self.get_step_inputs(step_id).get(name).get_value_data()
print(f" {name}: {new_value}")
step_outputs_changed(self, event)
¶
Method to override if the implementing controller needs to react to events where one or several step outputs have changed.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event |
StepOutputEvent |
the step output event |
required |
Source code in kiara/examples/example_controller.py
def step_outputs_changed(self, event: StepOutputEvent):
print("Step outputs changed, new values:")
for step_id, output_names in event.updated_step_outputs.items():
print(f" - step '{step_id}':")
for name in output_names:
new_value = self.get_step_outputs(step_id).get(name).get_value_data()
print(f" {name}: {new_value}")