loki.batch.pipeline
Classes
|
A transformation pipeline that combines multiple |
- class Pipeline(*args, classes=None, **kwargs)
Bases:
objectA transformation pipeline that combines multiple
Transformationpasses and allows to apply them in unison.The associated
Transformationobjects are constructed from keyword arguments in the constructor, so shared keywords get same initial value.- transformations
The list of transformations applied to a source in this pipeline
- Type:
list of
Transformation
- Parameters:
classes (tuple of types) – A tuple of types from which to instantiate
Transformationobjects.*args (optional) – Positional arguments that are passed on to the constructors of all transformations
**kwargs (optional) – Keyword arguments that are matched to the constructor signature of the transformations.
- prepend(transformation)
Prepend a fully instantiated
Transformationobject to this pipeline.- Parameters:
transformation (
Transformation) – Transformation object to prepend
- append(transformation)
Append a fully instantiated
Transformationobject to this pipeline.- Parameters:
transformation (
Transformation) – Transformation object to append
- extend(pipeline)
Append all :any`Transformation` objects of a given
Pipeline- Parameters:
pipeline (
Pipeline) – Pipeline whose transformations will be appended
- apply(source, **kwargs)
Apply each associated
TransformationtosourceIt dispatches to the respective
apply()of eachTransformationin the order specified in the constructor.- Parameters:
source (
SourcefileorModuleorSubroutine) – The source item to transform.**kwargs (optional) – Keyword arguments that are passed on to the methods defining the actual transformation.