Skip to content

Commit ad61632

Browse files
committed
Fix lambda coords
1 parent 5b01def commit ad61632

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

linopy/model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,10 @@ def add_piecewise_constraint(
746746
if is_single:
747747
# Single expression case
748748
target_expr = self._to_linexpr(expr)
749-
lambda_coords = breakpoints.coords
749+
# Build lambda coordinates from breakpoints dimensions
750+
lambda_coords = [
751+
pd.Index(breakpoints.coords[d].values, name=d) for d in breakpoints.dims
752+
]
750753
lambda_mask = self._compute_pwl_mask(mask, breakpoints, skip_nan_check)
751754

752755
else:

0 commit comments

Comments
 (0)