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 src/sgn/frames.py
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 src/sgn/frames.py
IterFrame
dataclass
¶
Bases: Frame
flowchart TD
sgn.frames.IterFrame[IterFrame]
sgn.frames.Frame[Frame]
sgn.frames.Frame --> sgn.frames.IterFrame
click sgn.frames.IterFrame href "" "sgn.frames.IterFrame"
click sgn.frames.Frame href "" "sgn.frames.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()
|