Skip to content

← formatting package

CreatePacket

Create a packet from chunks and their desired names.

A packet is a listing of one or more chunks, each of which is identified by a name (for more information, see the paragraph below or the NeuroPype documentation). Since a packet is not allowed to have None values for its chunks, any input chunks that are None are automatically dropped out from the resulting packet. When naming chunks, the properties name0..nameN must be assigned in a contiguous fashion, i.e., intermediate names that are unspecified (None) are not allowed. Chunks can also be automatically named based on the modality if desired using the auto_naming option. Generally if a duplicate name is given, then by convention all occurrences of that name, including the first occurrence, will have a number appended as in 'eeg-1', 'eeg-2', etc. A packet represents data from one or more named data streams (e.g., for raw time-series data, streams could be 'eeg', 'gaze', and 'markers'). In a real-time setting, a packet holds a short time slice of data from each stream (thus the name packet, in analogy with transmission packet), and for each stream it contains a brief chunk of data from that stream (which contains the actual array data and stream properties). In a batch/post-hoc analysis setting, a packet can hold the entire length of the data, and generally it is by no means restricted to time series data, but may hold arbitrary derived data (such as a time/frequency decompositions, statistics, and so forth). The names "chunk" and "stream" are often used interchangeably in NeuroPype, but the Chunk is the concrete data structure that makes up packets, and stream is often used for a less technical audience and to allude to the notion that a chunk stems from or belongs to a particular named data stream (which may represent an LSL stream, and/or a stream of timeseries data of a given modality imported from a file). Version 1.0.1

Ports/Properties

data

Output packet.

verbose name
Data
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
OUT

name1

Name 1.

verbose name
Name1
default value
None
port type
StringPort
value type
str (can be None)

chunk1

Chunk 1.

verbose name
Chunk1
default value
None
port type
DataPort
value type
Chunk (can be None)
data direction
IN

name2

Name 2.

verbose name
Name2
default value
None
port type
StringPort
value type
str (can be None)

chunk2

Chunk 2.

verbose name
Chunk2
default value
None
port type
DataPort
value type
Chunk (can be None)
data direction
IN

name3

Name 3.

verbose name
Name3
default value
None
port type
StringPort
value type
str (can be None)

chunk3

Chunk 3.

verbose name
Chunk3
default value
None
port type
DataPort
value type
Chunk (can be None)
data direction
IN

name4

Name 4.

verbose name
Name4
default value
None
port type
StringPort
value type
str (can be None)

chunk4

Chunk 4.

verbose name
Chunk4
default value
None
port type
DataPort
value type
Chunk (can be None)
data direction
IN

name5

Name 5.

verbose name
Name5
default value
None
port type
StringPort
value type
str (can be None)

chunk5

Chunk 5.

verbose name
Chunk5
default value
None
port type
DataPort
value type
Chunk (can be None)
data direction
IN

name6

Name 6.

verbose name
Name6
default value
None
port type
StringPort
value type
str (can be None)

chunk6

Chunk 6.

verbose name
Chunk6
default value
None
port type
DataPort
value type
Chunk (can be None)
data direction
IN

name7

Name 7.

verbose name
Name7
default value
None
port type
StringPort
value type
str (can be None)

chunk7

Chunk 7.

verbose name
Chunk7
default value
None
port type
DataPort
value type
Chunk (can be None)
data direction
IN

name8

Name 8.

verbose name
Name8
default value
None
port type
StringPort
value type
str (can be None)

chunk8

Chunk 8.

verbose name
Chunk8
default value
None
port type
DataPort
value type
Chunk (can be None)
data direction
IN

name9

Name 9.

verbose name
Name9
default value
None
port type
StringPort
value type
str (can be None)

chunk9

Chunk 9.

verbose name
Chunk9
default value
None
port type
DataPort
value type
Chunk (can be None)
data direction
IN

nameN

Additional chunk names in list form.

verbose name
Additional Chunk Names
default value
None
port type
ListPort
value type
list (can be None)

chunkN

Additional chunks.

verbose name
Chunkn
default value
None
port type
DataPort
value type
list (can be None)
data direction
IN

none_if_empty

Output None if all inputs are empty.

verbose name
Output None If All Empty
default value
True
port type
BoolPort
value type
bool (can be None)

auto_naming

Optionally auto-generate names for chunks instead of using manually-assigned names. If 'no', then this is disabled; names can then only be passed in if auto_naming is set to no. If set to 'auto', then if the chunk has a specified modality property, it will be named according to the modality (lowercased), else if it is an event stream it will be named 'markers', and otherwise it will be named 'chunk'.

verbose name
Auto Naming
default value
no
port type
EnumPort
value type
str (can be None)

verbose

Enable verbose diagnostics output.

verbose name
Verbose
default value
False
port type
BoolPort
value type
bool (can be None)

name0

Name 0.

verbose name
Name0
default value
None
port type
StringPort
value type
str (can be None)

chunk0

Chunk 0.

verbose name
Chunk0
default value
None
port type
DataPort
value type
Chunk (can be None)
data direction
IN

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)