Validation at Start

A pipeline that cannot work is refused before it produces anything, with a message that names the node and says what to change. Since version 4.0 that is the rule; before, such a pipeline started and showed a scope that never updated. The checks happen at three moments.

Three checkpoints before data flows: each connection as it is made, the whole pipeline when start() is called, and each node's inputs on its first frame. A failed check raises an error that names the node.

1. When you connect

p.connect() checks the connection it is making, so the mistake is reported on the line that made it.

  • Events into a continuous input, or the reverse, is a TypeError. A Marker connected straight to a filter gives “Cannot connect output port ‘out’ (Async) to input port ‘in’ (Sync): one carries a continuous stream and the other carries events …”. Events join a signal through a Router, which places them on its samples (Time and Synchronisation).

  • A connection that closes a loop with nothing in it is a ValueError: “the connection closes a feedback loop: Equation -> Lowpass -> Equation …”. A node fires only once every input has a frame, so such a loop would never fire. A Delay in the loop breaks the wait; Season 2, Episode 7 builds one.

2. When the pipeline starts

p.start() checks the pipeline as a whole before any node runs, and raises a ValueError for:

  • No continuous source at all, only events – “this pipeline has no continuously sampled source: Marker emits events, and an event has no position until something places it on a sample grid …”.

  • An input left unconnected on a Router, an Equation or a Collector, or a Trigger’s trigger input, which all take their timing from what connects to them – “input ‘in2’ of Router is not connected …”.

  • A recording read in realtime beside a live source – “a file source cannot be combined with live sources …” (Execution Modes).

  • A batch-only node in a realtime pipeline, such as a plain function turned into a node with @gp.node – “Apply runs only in a batch pipeline, and this one is ‘realtime’. A plain function has no bound on how long it takes …”.

  • A node that learns from data, with nothing learned yet – a Standardize or Sklearn needs p.fit() on a recording first (Offline Processing): “Standardize (‘z’) has no fitted state, and this pipeline is ‘realtime’. Fit it first …”.

3. On the first frame

Each node checks its own inputs when it sets up, on its first frame: until then it has not seen the sampling rate, channel count and frame size that arrive with the data. A node that cannot work with what it got stops the pipeline, and start() raises a RuntimeError naming it:

  • Inputs that disagree – “Router could not set up, so the pipeline is not running: ValueError: All ports must have the same sampling rate; Router got in1=500, in2=250 …”. The same goes for frame sizes (“Router got raw=4, feature=1”) and channel counts.

  • Something the node needs, missing from its context – the SqliteWriter of Season 7, Episode 3, a sink written in the training, says: “SqliteWriter needs sampling_rate and channel_count in its input context; got none.”

Every such message ends the same way: “Nothing was emitted and no sink wrote a row; fix what the node reported and start again.” A refused start leaves no half-written recording behind.

What it cannot catch

Validation catches pipelines that cannot run. It cannot catch one that runs and computes the wrong thing – a bandpass aimed at the wrong band is a perfectly valid pipeline, and its condition stays Healthy (Condition and Logging). A Collector either side of the node you suspect, compared on one number, finds those. A node you write yourself joins in by raising a ValueError from its setup(), and gets the same treatment.