AggregateCondition (autotransform.step.condition.aggregate)

The implementation for the AggregateCondition.

class autotransform.step.condition.aggregate.AggregateCondition(*, aggregator: AggregatorType, conditions: List[Condition])

Bases: Condition

A Condition which aggregates a list of Conditions using the supplied aggregator and returns the result of the aggregation.

aggregator

How to aggregate the conditions, using any or all.

Type

AggregatorType

conditions

The conditions to be aggregated.

Type

List[Condition]

name

The name of the Component.

Type

ClassVar[ConditionName]

aggregator: AggregatorType
check(change: Change) bool

Checks whether the aggregation of all conditions passes.

Parameters

change (Change) – The Change the Condition is checking.

Returns

Whether the Change passes the Condition.

Return type

bool

conditions: List[Condition]
classmethod from_data(data: Dict[str, Any]) AggregateCondition

Produces an instance of the component from decoded data.

Parameters

data (Dict[str, Any]) – The JSON decoded data.

Returns

An instance of the component.

Return type

AggregateCondition

name: ClassVar[ConditionName] = 'aggregate'
class autotransform.step.condition.aggregate.AggregatorType(value)

Bases: str, Enum

A list of possible comparisons.

ALL = 'all'
ANY = 'any'