ArangeLoop

class caqtus.types.iteration.ArangeLoop(
sub_steps: list[TypeAliasForwardRef('Step')],
variable: DottedVariableName,
start: Expression,
stop: Expression,
step: Expression,
)

Bases: ContainsSubSteps

Represents a loop that iterates between two values with a fixed step size.

variable

The name of the variable that is being iterated over.

Type:

caqtus.types.variable_name.DottedVariableName

start

The start value of the variable.

Type:

caqtus.types.expression._expression.Expression

stop

The stop value of the variable.

Type:

caqtus.types.expression._expression.Expression

step

The step size between each value.

Type:

caqtus.types.expression._expression.Expression

loop_values(
evaluation_context: Mapping[DottedVariableName, Any],
) Iterator[float | Quantity[float, Unit]]

Returns the values that the variable represented by this loop takes.

Parameters:

evaluation_context – Contains the value of the variables with which to evaluate the start, stop and step expressions of the loop.

Raises:
  • EvaluationError – if the start, stop or step expressions could not be evaluated.

  • NotAnalogValueError – if the start, stop or step expressions don’t evaluate to an analog value.

  • InvalidDimensionalityError – if the start, stop and step values are not commensurate.