Pipeline

class ioiocore.pipeline.Pipeline(directory=None)[source]

Bases: Interface

A class representing a pipeline, inheriting from Interface. Manages nodes and their connections within the pipeline.

Parameters:

directory (str)

__init__(directory=None)[source]

Initializes the pipeline.

Parameters:

directory (str, optional) – Directory to be used for the pipeline (default is None).

add_node(node)[source]

Adds a node to the pipeline.

Parameters:

node (Node) – The node to add to the pipeline.

connect(source, target)[source]
Parameters:
static deserialize(data)[source]

Deserializes the pipeline from a dictionary.

Parameters:

data (dict) – A dictionary containing the serialized pipeline data.

Returns:

The deserialized pipeline object.

Return type:

Pipeline

get_condition()[source]

Returns the current condition of the pipeline.

Returns:

The current condition of the pipeline.

Return type:

Constants.Conditions

get_elapsed_time()[source]

Returns the elapsed time since the pipeline started.

Returns:

The elapsed time in seconds.

Return type:

float

get_last_error()[source]

Returns the last error message from the pipeline.

Returns:

The last error message.

Return type:

str

get_state()[source]

Returns the current state of the pipeline.

Returns:

The current state of the pipeline.

Return type:

Constants.States

log(msg, type=None)[source]

Writes a log entry to the pipeline.

Parameters:
  • entry (str) – The log entry to write.

  • msg (str)

  • type (LogTypes)

serialize()[source]

Serializes the pipeline to a dictionary.

Returns:

A dictionary representing the serialized pipeline.

Return type:

dict

start()[source]

Starts the pipeline.

stop()[source]

Stops the pipeline.