constraint module

Define Constraint, which stores a constraint.

It saves it’s name, limits, and methods to evaluate if it is violated or not.

IMPLEMENTED_CONSTRAINTS = ('phi_s',)
class Constraint(name, element_name, limits)[source]

Bases: DesignSpaceParameter

A single constraint.

For now, it can only be a synchronous phase limits.

Parameters:
__post_init__()[source]

Convert values in deg for output if it is angle.

property kwargs: dict[str, bool]

Return the kwargs to send a get method.

property n_constraints: int

Return number of embedded constraints in this object.

A lower + and upper bound count as two constraints.

get_value(simulation_output)[source]

Get from the SimulationOutput the quantity called self.name.

Parameters:

simulation_output (SimulationOutput)

Return type:

float

evaluate(simulation_output)[source]

Check if constraint is respected. They should be < 0.

Parameters:

simulation_output (SimulationOutput)

Return type:

tuple[float, float]

__init__(name, element_name, limits)
Parameters:
Return type:

None

_abc_impl = <_abc._abc_data object at 0x76a8667e75c0>