Skip to content

sift_py.calculated_channels.config

CLASS DESCRIPTION
CalculatedChannelConfig

Configuration for a calculated channel.

CalculatedChannelUpdate

Represents a dictionary for updating properties of a calculated channel. All fields are optional

CalculatedChannelConfig

Bases: BaseModel

Configuration for a calculated channel.

  • name: Name of the calculated channel.
  • description: Description of the calculated channel.
  • expression: The expression to calculate the value of the calculated channel.
  • channel_references: A list of channel references that are used in the expression. Each reference can either be an ExpressionChannelReference or ExpressionChannelReferenceChannelConfig.
  • units: Units of the calculated channel.
  • client_key: A user defined string that uniquely identifies the calculated channel. Name is unique, but may be changed.
  • asset_names: A list of asset names to make the calculation available for.
  • tags: A list of tags on assets to make the calculation available for. NOTE: Not yet supported.
  • all_assets: A flag that, when set to True, associates the calculated channel with all assets.
METHOD DESCRIPTION
check_for_unsupported_tags
convert_channel_references
validate_assets
ATTRIBUTE DESCRIPTION
all_assets

TYPE: bool

asset_names

TYPE: Optional[List[str]]

calculated_channel_id

TYPE: Optional[str]

channel_references

TYPE: List[Union[ExpressionChannelReference, ExpressionChannelReferenceChannelConfig]]

client_key

TYPE: Optional[str]

description

TYPE: str

expression

TYPE: str

model_config

name

TYPE: str

tag_names

TYPE: Optional[List[str]]

units

TYPE: Optional[str]

all_assets class-attribute instance-attribute

all_assets: bool = False

asset_names class-attribute instance-attribute

asset_names: Optional[List[str]] = None

calculated_channel_id class-attribute instance-attribute

calculated_channel_id: Optional[str] = None

channel_references instance-attribute

client_key class-attribute instance-attribute

client_key: Optional[str] = None

description class-attribute instance-attribute

description: str = ''

expression instance-attribute

expression: str

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True)

name instance-attribute

name: str

tag_names class-attribute instance-attribute

tag_names: Optional[List[str]] = None

units class-attribute instance-attribute

units: Optional[str] = None

check_for_unsupported_tags classmethod

check_for_unsupported_tags(v)

convert_channel_references classmethod

validate_assets

validate_assets()

CalculatedChannelUpdate

Bases: TypedDict

Represents a dictionary for updating properties of a calculated channel. All fields are optional and only the provided fields will be updated.

  • name: Updated name of the calculated channel.
  • description: Updated description of the calculated channel.
  • units: String representing the units for the calculated channel.
  • expression: Updated expression used to calculate channel values.
  • channel_references: A list of channel references which can either be ExpressionChannelReference or ExpressionChannelReferenceChannelConfig used in the expression.
  • asset_names: List of assets associated with the calculation.
  • tags: List of tags for associating the calculated channel to assets.
  • all_assets: Boolean flag indicating if the calculated channel applies to all assets.
  • archived: Boolean flag indicating if the calculated channel is archived.
ATTRIBUTE DESCRIPTION
all_assets

TYPE: NotRequired[bool]

archived

TYPE: NotRequired[bool]

asset_names

TYPE: NotRequired[List[str]]

channel_references

TYPE: NotRequired[List[Union[ExpressionChannelReference, ExpressionChannelReferenceChannelConfig]]]

description

TYPE: NotRequired[str]

expression

TYPE: NotRequired[str]

name

TYPE: NotRequired[str]

tag_names

TYPE: NotRequired[List[str]]

units

TYPE: NotRequired[str]

all_assets instance-attribute

all_assets: NotRequired[bool]

archived instance-attribute

archived: NotRequired[bool]

asset_names instance-attribute

asset_names: NotRequired[List[str]]

channel_references instance-attribute

description instance-attribute

description: NotRequired[str]

expression instance-attribute

expression: NotRequired[str]

name instance-attribute

name: NotRequired[str]

tag_names instance-attribute

tag_names: NotRequired[List[str]]

units instance-attribute

units: NotRequired[str]