Pipeline
An ordered sequence of analysis stages.
Usage
Pipeline()Construct a pipeline from callables, then run data through each stage in sequence.
Parameters
name: str-
Human-readable pipeline identifier.
Attributes
name-
Pipeline name.
stages: list-
Ordered list of stage callables.
Examples
>>> p = Pipeline("demo")
>>> p.add_stage(lambda x: [v * 2 for v in x])
>>> p.run([1, 2, 3])
[2, 4, 6]Methods
| Name | Description |
|---|---|
| add_stage() | Append a processing stage. |
| clear() | Remove all stages from the pipeline. |
| run() | Execute all stages sequentially. |
add_stage()
Append a processing stage.
Usage
add_stage(fn)Parameters
fn-
A callable that accepts and returns a list.
clear()
Remove all stages from the pipeline.
Usage
clear()run()
Execute all stages sequentially.
Usage
run(data)Parameters
data: list-
Input data list.
Returns
list-
The data after passing through every stage.