Skip to content

Commit 45285ee

Browse files
fix: add coords and dims to as_dataarray (#582)
1 parent 75c442c commit 45285ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

linopy/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ def add_constraints(
746746
(data,) = xr.broadcast(data, exclude=[TERM_DIM])
747747

748748
if mask is not None:
749-
mask = as_dataarray(mask).astype(bool)
749+
mask = as_dataarray(mask, coords=data.coords, dims=data.dims).astype(bool)
750750
mask = broadcast_mask(mask, data.labels)
751751

752752
# Auto-mask based on null expressions or NaN RHS (use numpy for speed)

0 commit comments

Comments
 (0)