ltbio.pipeline#

Overview#

Submodules#

Classes#

ApplySeparately

An ApplySeparately is a collection of single units, to which each will be applied to one Timeseries at a time.

ApplyTogether

An ApplyTogether is a collection of single units, to which each will be applied to all Timeseries at once.

GoTo

-

Input

A Single Pipeline Unit is any agent that can act (use, process or make changes) to a collection (usually of Timeseries).

Pipeline

-

Contents#

class ltbio.pipeline.ApplySeparately(units: SinglePipelineUnit | Collection[SinglePipelineUnit], name: str = None)#

Bases: PipelineUnitsUnion

digraph inheritance61e9989c3e { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "ApplySeparately" [URL="PipelineUnit/index.html#ltbio.pipeline.PipelineUnit.ApplySeparately",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An ApplySeparately is a collection of single units, to which each will be applied to one Timeseries at a time."]; "PipelineUnitsUnion" -> "ApplySeparately" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PipelineUnit" [URL="PipelineUnit/index.html#ltbio.pipeline.PipelineUnit.PipelineUnit",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Pipeline Units are the building blocks of Pipelines."]; "ABC" -> "PipelineUnit" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PipelineUnitsUnion" [URL="PipelineUnit/index.html#ltbio.pipeline.PipelineUnit.PipelineUnitsUnion",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A Union is a collection of single units where the Pipeline branches to each of them."]; "PipelineUnit" -> "PipelineUnitsUnion" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "PipelineUnitsUnion" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

An ApplySeparately is a collection of single units, to which each will be applied to one Timeseries at a time. Following the Template Method design pattern, this is a concrete class, where ‘__delegate’ is implemented.

class ltbio.pipeline.ApplyTogether(units: SinglePipelineUnit | Collection[SinglePipelineUnit], name: str = None)#

Bases: PipelineUnitsUnion

digraph inheritanceeb02dcab59 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "ApplyTogether" [URL="PipelineUnit/index.html#ltbio.pipeline.PipelineUnit.ApplyTogether",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="An ApplyTogether is a collection of single units, to which each will be applied to all Timeseries at once."]; "PipelineUnitsUnion" -> "ApplyTogether" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PipelineUnit" [URL="PipelineUnit/index.html#ltbio.pipeline.PipelineUnit.PipelineUnit",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Pipeline Units are the building blocks of Pipelines."]; "ABC" -> "PipelineUnit" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PipelineUnitsUnion" [URL="PipelineUnit/index.html#ltbio.pipeline.PipelineUnit.PipelineUnitsUnion",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A Union is a collection of single units where the Pipeline branches to each of them."]; "PipelineUnit" -> "PipelineUnitsUnion" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "PipelineUnitsUnion" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

An ApplyTogether is a collection of single units, to which each will be applied to all Timeseries at once. Following the Template Method design pattern, this is a concrete class, where ‘__delegate’ is implemented.

class ltbio.pipeline.GoTo(name=None)#

Bases: ltbio.pipeline.PipelineUnit.SinglePipelineUnit

digraph inheritanceb9798aa8cc { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "GoTo" [URL="GoTo/index.html#ltbio.pipeline.GoTo.GoTo",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "SinglePipelineUnit" -> "GoTo" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PipelineUnit" [URL="PipelineUnit/index.html#ltbio.pipeline.PipelineUnit.PipelineUnit",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Pipeline Units are the building blocks of Pipelines."]; "ABC" -> "PipelineUnit" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SinglePipelineUnit" [URL="PipelineUnit/index.html#ltbio.pipeline.PipelineUnit.SinglePipelineUnit",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A Single Pipeline Unit is any agent that can act (use, process or make changes) to a collection (usually of Timeseries)."]; "PipelineUnit" -> "SinglePipelineUnit" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "SinglePipelineUnit" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
ART_PATH = 'resources/pipeline_media/goto.png'#
apply(step_number: int)#
class ltbio.pipeline.Input(label: str, data, name: str = None)#

Bases: ltbio.pipeline.PipelineUnit.SinglePipelineUnit

digraph inheritance114918d645 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Input" [URL="Input/index.html#ltbio.pipeline.Input.Input",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "SinglePipelineUnit" -> "Input" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PipelineUnit" [URL="PipelineUnit/index.html#ltbio.pipeline.PipelineUnit.PipelineUnit",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Pipeline Units are the building blocks of Pipelines."]; "ABC" -> "PipelineUnit" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SinglePipelineUnit" [URL="PipelineUnit/index.html#ltbio.pipeline.PipelineUnit.SinglePipelineUnit",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="A Single Pipeline Unit is any agent that can act (use, process or make changes) to a collection (usually of Timeseries)."]; "PipelineUnit" -> "SinglePipelineUnit" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "SinglePipelineUnit" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

A Single Pipeline Unit is any agent that can act (use, process or make changes) to a collection (usually of Timeseries). Following the Command design pattern, a SingleUnit is the abstract ‘Command’, so that Pipeline can execute various kinds of processing by calling the ‘apply’ method of each concrete unit.

E.g. Filter, Segmenter, FeatureExtractor, FeatureSelector, SupervisingTrainer, DecisionMaker Any subclass that implements ‘apply’.

Every subclass must define ‘apply’ and implement a concrete behaviour. To map the parameters’ names of ‘apply’ to the labels inside any arriving Packet, PIPELINE_INPUT_LABELS should be defined. To map the outputs to the labels of the resulting Packet, PIPELINE_OUTPUT_LABELS should be defined.

PIPELINE_INPUT_LABELS Maps every label of a needed input inside a Packet to the name of the corresponding ‘apply’ parameter. PIPELINE_OUTPUT_LABELS Maps every output name of ‘apply’ to a label to be saved inside a Packet.

ART_PATH = 'resources/pipeline_media/input.png'#
PIPELINE_INPUT_LABELS#
PIPELINE_OUTPUT_LABELS#
apply()#
class ltbio.pipeline.Pipeline(name: str = None)#
property current_packet: ltbio.pipeline.Packet.Packet#
property current_step: int#
add(unit: ltbio.pipeline.PipelineUnit.PipelineUnit)#
applyAll(biosignals: Biosignal | Collection[Biosignal])#
load(biosignals: Biosignal | Collection[Biosignal])#
next()#
plot_diagram(show: bool = True, save_to: str = None)#