Skip to content

odys.optimization.constraints.model_constraint

Internal implementation detail. Most users do not need this page directly.

See Risk (CVaR) in the User Guide for the public API.

Named constraint wrapper for linopy constraints.

ModelConstraint

Bases: BaseModel

A named linopy constraint ready to be added to the model.

Source code in src/odys/optimization/constraints/model_constraint.py
 7
 8
 9
10
11
12
13
14
15
16
17
class ModelConstraint(BaseModel):
    """A named linopy constraint ready to be added to the model."""

    model_config = ConfigDict(
        frozen=True,
        extra="forbid",
        arbitrary_types_allowed=True,
    )

    constraint: linopy.ConstraintBase
    name: str