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 pydantic-model

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.

Config:

  • arbitrary_types_allowed: True

Fields:

Validators:

all_assets pydantic-field

all_assets: bool = False

asset_names pydantic-field

asset_names: Optional[List[str]] = None

calculated_channel_id pydantic-field

calculated_channel_id: Optional[str] = None

channel_references pydantic-field

client_key pydantic-field

client_key: Optional[str] = None

description pydantic-field

description: str = ''

expression pydantic-field

expression: str

model_config class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True)

name pydantic-field

name: str

tag_names pydantic-field

tag_names: Optional[List[str]] = None

units pydantic-field

units: Optional[str] = None

check_for_unsupported_tags pydantic-validator

check_for_unsupported_tags(v)

convert_channel_references pydantic-validator

convert_channel_references(
    raw: List[
        Union[
            ExpressionChannelReference,
            ExpressionChannelReferenceChannelConfig,
        ]
    ],
) -> List[ExpressionChannelReference]

validate_assets pydantic-validator

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

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

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]