diff --git a/linopy/expressions.py b/linopy/expressions.py index 555d2275..5467b7d5 100644 --- a/linopy/expressions.py +++ b/linopy/expressions.py @@ -767,7 +767,8 @@ def _align_constant( Fill value for missing coordinates. join : str, optional Alignment method. If None, the default is determined by - ``options["semantics"]`` — ``"exact"`` under ``v1``, the + ``options["semantics"]`` — under ``v1`` shared dimensions must + carry the same label set (a pure reorder aligns by label), the legacy size-aware behavior under ``legacy``. Returns @@ -1067,10 +1068,10 @@ def add( The expression to add. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - semantics default: "exact" under v1 (order-independent — a pure - reorder aligns by label, only a differing label set raises), the - legacy positional behavior under legacy. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ if join is None: return self.__add__(other) @@ -1097,10 +1098,10 @@ def sub( The expression to subtract. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - semantics default: "exact" under v1 (order-independent — a pure - reorder aligns by label, only a differing label set raises), the - legacy positional behavior under legacy. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ return self.add(-other, join=join) @@ -1118,10 +1119,10 @@ def mul( The factor to multiply by. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - semantics default: "exact" under v1 (order-independent — a pure - reorder aligns by label, only a differing label set raises), the - legacy positional behavior under legacy. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ if join is None: return self.__mul__(other) @@ -1145,10 +1146,10 @@ def div( The divisor. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - semantics default: "exact" under v1 (order-independent — a pure - reorder aligns by label, only a differing label set raises), the - legacy positional behavior under legacy. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ if join is None: return self.__div__(other) @@ -1174,10 +1175,10 @@ def le( Right-hand side of the constraint. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - semantics default: "exact" under v1 (order-independent — a pure - reorder aligns by label, only a differing label set raises), the - legacy positional behavior under legacy. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ return self.to_constraint(LESS_EQUAL, rhs, join=join) @@ -1195,10 +1196,10 @@ def ge( Right-hand side of the constraint. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - semantics default: "exact" under v1 (order-independent — a pure - reorder aligns by label, only a differing label set raises), the - legacy positional behavior under legacy. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ return self.to_constraint(GREATER_EQUAL, rhs, join=join) @@ -1216,10 +1217,10 @@ def eq( Right-hand side of the constraint. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - semantics default: "exact" under v1 (order-independent — a pure - reorder aligns by label, only a differing label set raises), the - legacy positional behavior under legacy. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ return self.to_constraint(EQUAL, rhs, join=join) @@ -1479,10 +1480,10 @@ def to_constraint( raise a ValueError. NaN entries in the RHS mean "no constraint". join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - semantics default: "exact" under v1 (order-independent — a pure - reorder aligns by label, only a differing label set raises), the - legacy positional behavior under legacy. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. Returns ------- diff --git a/linopy/variables.py b/linopy/variables.py index ddd258bf..8f80e370 100644 --- a/linopy/variables.py +++ b/linopy/variables.py @@ -625,8 +625,10 @@ def add( The expression to add. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - current default behavior. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ return self.to_linexpr().add(other, join=join) @@ -642,8 +644,10 @@ def sub( The expression to subtract. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - current default behavior. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ return self.to_linexpr().sub(other, join=join) @@ -659,8 +663,10 @@ def mul( The coefficient to multiply by. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - current default behavior. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ return self.to_linexpr().mul(other, join=join) @@ -676,8 +682,10 @@ def div( The divisor. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - current default behavior. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ return self.to_linexpr().div(other, join=join) @@ -691,8 +699,10 @@ def le(self, rhs: SideLike, join: JoinOptions | None = None) -> Constraint: Right-hand side of the constraint. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - current default behavior. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ return self.to_linexpr().le(rhs, join=join) @@ -706,8 +716,10 @@ def ge(self, rhs: SideLike, join: JoinOptions | None = None) -> Constraint: Right-hand side of the constraint. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - current default behavior. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ return self.to_linexpr().ge(rhs, join=join) @@ -721,8 +733,10 @@ def eq(self, rhs: SideLike, join: JoinOptions | None = None) -> Constraint: Right-hand side of the constraint. join : str, optional How to align coordinates. One of "outer", "inner", "left", - "right", "exact", "override". When None (default), uses the - current default behavior. + "right", "exact", "override". When None (default), follows the + semantics setting: under v1, shared dimensions must carry the + same label set — a pure reorder aligns by label, a differing set + raises; under legacy, positional alignment. """ return self.to_linexpr().eq(rhs, join=join)