Pipeline#

class pypillometry.Pipeline(steps=())[source]#

Bases: object

A sequence of pipeline steps, applied with d | pipeline.

A pipeline is a value: it can be stored, printed and applied to many data objects (e.g., all subjects of a study). Applying it copies the data object once and then runs each step in place on the copy, so the original object is not changed. (In d | a | b, which Python reads as (d | a) | b, each | copies; d | (a | b) copies once.) Each step is recorded in the history of the result. If a step fails, the error says which one.

Pipelines are usually made by combining steps with |:

preproc = pp.pupil.blinks_detect() | pp.pupil.blinks_interpolate() \
          | pp.pupil.lowpass_filter(5)
data = {subj: d | preproc for subj, d in datasets.items()}
Parameters:

steps (iterable of Step) – the steps, in the order in which they are applied

Details