sgn.frames
¶
Frame classes for the SGN framework.
DataSpec
dataclass
¶
A specification for the type of data stored in frames.
All properties in this specification will be expected to match what is stored in the frame, and what is being transferred between source and sink pads.
Source code in sgn/frames.py
9 10 11 12 13 14 15 16 17 18 19 20 |
|
Frame
dataclass
¶
Generic class to hold the basic unit of data that flows through a graph.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
EOS
|
bool
|
bool, default False, Whether this frame indicates end of stream (EOS) |
False
|
is_gap
|
bool
|
bool, default False, Whether this frame is marked as a gap |
False
|
spec
|
DataSpec
|
DataSpec, optional, a specification for the data captured in this frame |
DataSpec()
|
data
|
Any
|
Any, the data to store in the frame |
None
|
metadata
|
dict
|
dict, optional, Metadata associated with this frame. |
dict()
|
Source code in sgn/frames.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
IterFrame
dataclass
¶
Bases: Frame
A frame whose data attribute is an iterable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Iterable[Any]
|
Iterable, the data to store in the frame |
list()
|
Source code in sgn/frames.py
50 51 52 53 54 55 56 57 58 59 |
|