GateCheck¶
Check that the data packet meets certain criteria before allowing it to pass through.
For example, that the required streams and markers are present, that the data is of a minimum (or maximum) length along a certain axis (time, space), that certain axes are present or absent, and that the data contains no NaNs. If the data passes the gate check, the packet is passed through unchanged, otherwise, None is passed (or optionally an exception is raised to terminate the pipeline). When the check fails with on_fail set to 'error' or 'raise', the failure message can be retrieved from a running NeuroPype server via the /errors API endpoint. Version 2.0.0
Ports/Properties¶
data¶
Data
signal_streams¶
Names of the signal streams to check. Wildcards are supported (only * and ? pattern matching, not regular expressions), e.g., eeg* to match all streams whose name begins with eeg. If empty, the first signal stream found will be checked. When more than one stream matches, all matching streams must satisfy the signal criteria.
marker_streams¶
Names of the marker streams to check for markers (used together with required_markers, and as a presence criterion). Wildcards are supported (* and ?); use * to require that a marker stream of any name is present. If specified, each pattern must match at least one stream in the packet, otherwise the check fails. If empty, the first marker stream found is used (for required_markers) and no presence check is performed.
axis¶
The axis along which to check that the minimum/maximum threshold of elements exist.
required_streams¶
List of stream names which must be present in the data packet.
require_data¶
If True, check that the signal stream is not empty (contains at least one data element).
min_length¶
Minimum number of elements which must appear in the selected axis (i.e ., samples if time, channels if space). If set to None or 0, this check is skipped.
max_length¶
Maximum number of elements which may appear in the selected axis. Useful to catch very large data that could otherwise cause a memory error. If set to None or 0, this check is skipped.
unit¶
Unit in which the minimum/maximum length is specified. For most axes, 'elements' is the right choice and would count the number of elements, or items, along that axis (i.e., the number of channels in the space axis, or frequencies in the frequency axis, samples in the time axis). For the time axis, 'seconds' is provided to allow you to specify the length in seconds rather than in samples.
required_axes¶
List of axes which must be present in the checked signal stream(s). Leave empty to skip this check.
excluded_axes¶
List of axes which must NOT be present in the checked signal stream(s). Leave empty to skip this check.
no_nans¶
If True, check that the data packet contains no NaNs.
required_markers¶
List of markers which must each appear at least once in the selected marker stream/s. Wildcards are supported (* and ?, case-sensitive); use * to require that at least one marker (of any name) is present. Leave empty to skip this check.
on_fail¶
What to do when one or more checks fail. In all cases except 'raise', None is passed through in place of the data so that downstream nodes can skip it. 'ignore' passes None silently; 'warn' logs a warning; 'error' logs an error; 'raise' raises an exception and terminates the pipeline. When set to 'error' or 'raise', the failure message (listing the failed criteria) is also retrievable from a running NeuroPype server via the /executions/<id>/errors API endpoint, so a controlling application can find out why the pipeline failed.
signal_stream¶
marker_stream¶
check_no_nans¶
raise_on_fail¶
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.