sift_py.ingestion.channel
¶
| CLASS | DESCRIPTION |
|---|---|
ChannelBitFieldElement |
|
ChannelConfig |
A description for a channel |
ChannelDataType |
Utility enum class to simplify working with channel data-types generated from protobuf |
ChannelDataTypeStrRep |
|
ChannelEnumType |
|
ChannelValue |
Represents a fully qualified data point for a channel |
| FUNCTION | DESCRIPTION |
|---|---|
bit_field_value |
|
bool_value |
|
bytes_value |
|
channel_fqn |
Computes the fully qualified channel name. |
double_value |
|
empty_value |
|
enum_value |
|
float_value |
|
int32_value |
|
int64_value |
|
is_data_type |
|
string_value |
|
uint32_value |
|
uint64_value |
|
ChannelBitFieldElement
¶
ChannelConfig
¶
ChannelConfig(
name: str,
data_type: ChannelDataType,
description: Optional[str] = None,
unit: Optional[str] = None,
component: Optional[str] = None,
bit_field_elements: List[ChannelBitFieldElement] = [],
enum_types: List[ChannelEnumType] = [],
)
Bases: AsProtobuf
A description for a channel
| METHOD | DESCRIPTION |
|---|---|
as_pb |
|
fqn |
NOTE: Component field of Channel has been deprecated. Function kept for backwards compatibility. |
from_pb |
|
try_value_from |
Generate a channel value for this particular channel configuration. This will raise an exception |
value_from |
Like |
| ATTRIBUTE | DESCRIPTION |
|---|---|
bit_field_elements |
TYPE:
|
component |
|
data_type |
TYPE:
|
description |
|
enum_types |
TYPE:
|
identifier |
TYPE:
|
name |
TYPE:
|
unit |
|
bit_field_elements
instance-attribute
¶
bit_field_elements: List[ChannelBitFieldElement] = (
bit_field_elements
)
fqn
¶
fqn() -> str
NOTE: Component field of Channel has been deprecated. Function kept for backwards compatibility.
The fully-qualified channel name of a channel called 'voltage' is simply voltage. The
fully qualified name of a channel called 'temperature' of component 'motor' is a `motor.temperature'.
try_value_from
¶
try_value_from(
value: Optional[Union[int, float, bool, str, bytes]],
) -> IngestWithConfigDataChannelValue
Generate a channel value for this particular channel configuration. This will raise an exception
if there is a type match, namely, if value isn't consistent with the channel's data-type. For a version
of this function that does not raise an exception and simply ignores type mistmatches, see value_from. If value
is None then an empty value will be generated.
ChannelDataType
¶
ChannelDataTypeStrRep
¶
ChannelEnumType
¶
ChannelValue
¶
channel_fqn
¶
channel_fqn(
channel: Union[
ChannelConfig,
ChannelConfig,
ChannelValue,
Channel,
_AbstractChannel,
],
) -> str
Computes the fully qualified channel name.
NOTE: Component field of Channel is deprecated and should not be used. Function is left for code compatibility.
The fully-qualified channel name of a channel called 'voltage' is simply voltage'. The
fully qualified name of a channel called 'temperature' of component 'motor' is amotor.temperature'.
is_data_type
¶
is_data_type(
val: IngestWithConfigDataChannelValue,
target_type: ChannelDataType,
) -> bool