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: str, element_name: str, limits: tuple[float, float])

Bases: DesignSpaceParameter

A single constraint.

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

__post_init__()

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: SimulationOutput) float

Get from the SimulationOutput the quantity called self.name.

evaluate(simulation_output: SimulationOutput) tuple[float, float]

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

__init__(name: str, element_name: str, limits: tuple[float, float]) None
_abc_impl = <_abc._abc_data object at 0x7fd3c8ad0080>