corelay.pipeline.base
Base classes Task and Pipeline.
Classes
Abstract base class for all pipelines using MetaPipeline's tracked Task attributes |
|
A single item in a |
|
Plug to ensure all contained objects are Processors |
- class corelay.pipeline.base.Pipeline(*args, **kwargs)[source]
Bases:
ProcessorAbstract base class for all pipelines using MetaPipeline’s tracked Task attributes
- task_scheme
OrderedDict of Tasks which can be filled with
Processor.- Type:
collections.OrderedDict
- processes
OrderedDict of the
Processorthat filled the task_scheme.- Type:
collections.OrderedDict
- checkpoint_processes()[source]
Find the checkpoint
Processorclosest to output and return ancollections.OrderedDictof that and all followingProcessor.- Returns:
The
Processorthat is the checkpoint closest to output and all its followingProcessorin anOrderedDict.- Return type:
collections.OrderedDict- Raises:
RuntimeError – If there is not a single checkpoint.
- from_checkpoint()[source]
Re-evaluate from last checkpointed
Processorusing its respective output.- Returns:
Output of the whole pipeline, starting from checkpointed
Processorclosest to output.- Return type:
object
- Raises:
RuntimeError – If the checkpointed
Processorclosest to output does not have any checkpoint_data store, i.e. theProcessorwas never called once after being declared a checkpoint.
- function(data)[source]
Propagate data through the whole pipeline from front to back, calling all Processors in series.
- data
The pipeline input passed to the first
Processorin self.processors. Type depends on firstProcessor.
- Returns:
Output of all
Processorthat are flagged as pipeline outputs. If no processors are flagged as outputs, return the output of the last processor.- Return type:
object
- class corelay.pipeline.base.Task(proc_type=<class 'corelay.processor.base.Processor'>, default=<function Task.<lambda>>, **kwargs)[source]
Bases:
SlotA single item in a
Pipelinetask scheme. Tasks are slots that ensure all contained objects in Plugs and own default values are Processors.- default
Default
Processorto use if no Processor is assigned. If atypes.FunctionTypeortypes.MethodType, an appropriateFunctionProcessorwill be created.- Type:
Processorortypes.FunctionTypeortypes.MethodType
- proc_kwargs
Keyword arguments to overwrite on the supplied Processor.
- Type:
dict