iris.callbacks package

Submodules

iris.callbacks.callback_interface module

class iris.callbacks.callback_interface.Callback[source]

Bases: ABC

Base class of the Callback API.

on_execute_end(result: Any) None[source]

Execute this method called after node execute method.

Parameters:

result (Any) – execute method output.

on_execute_start(*args: Any, **kwargs: Any) None[source]

Execute this method called before node execute method.

iris.callbacks.pipeline_trace module

class iris.callbacks.pipeline_trace.NodeResultsWriter(trace_storage_reference: PipelineCallTraceStorage, result_name: str)[source]

Bases: Callback

A node call results writer Callback class.

on_execute_end(result: Any) None[source]

Write on node execution end.

Parameters:

result (Any) – Result of node call.

class iris.callbacks.pipeline_trace.PipelineCallTraceStorage(results_names: Iterable[str])[source]

Bases: object

A storage object for pipeline input, intermediate and final results.

ERROR_KEY_NAME = 'error'
INPUT_KEY_NAME = 'input'
clean() None[source]

Clean storage by setting all result references to None.

get(result_name: str) Any[source]

Get result_name result.

Parameters:

result_name (str) – Result name.

Raises:

PipelineCallTraceStorageError – Raised if result_name is not found.

Returns:

Result object.

Return type:

Any

get_error() Exception | None[source]

Return stored error.

Returns:

error.

Return type:

Optional[Exception]

get_input() Any[source]

Return pipeline input.

Returns:

Input to pipeline.

Return type:

Any

static initialise(nodes: Dict[str, Algorithm], pipeline_nodes: List[PipelineNode]) PipelineCallTraceStorage[source]

Instantiate mechanisms for intermediate results tracing.

Parameters:
  • nodes (Dict[str, Algorithm]) – Mapping between nodes names and the corresponding instanciated nodes.

  • pipeline_nodes (List[PipelineNode]) – List of nodes as declared in the input config. Not used in this function.

Returns:

Pipeline intermediate and final results storage.

Return type:

PipelineCallTraceStorage

write(result_name: str, result: Any) None[source]

Write a result to a storage saved under the name result_name.

Parameters:
  • result_name (str) – Result name.

  • result (Any) – Result reference to save.

write_error(error: Exception) None[source]

Save error in storage.

Parameters:

error (Exception) – error to store.

write_input(in_value: Any) None[source]

Save in_value in storage.

Parameters:

in_value (Any) – Input value.

exception iris.callbacks.pipeline_trace.PipelineCallTraceStorageError[source]

Bases: Exception

PipelineCallTraceStorage error class.

Module contents