Skip to content

Commit ede540f

Browse files
Fix expression merge with outer join for disjoint coordinates (#514)
* fix: explicitly set outer join for expression merge Set join="outer" when merging expressions without common coordinate structure to ensure consistent behavior across xarray versions and properly handle expressions with disjoint coordinates. * doc: add release note for outer join fix in expression merge
1 parent 7c9206e commit ede540f

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

doc/release_notes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Upcoming Version
99
* Improved constraint equality check in `linopy.testing.assert_conequal` to less strict optionally
1010
* Minor bugfix for multiplying variables with numpy type constants
1111
* Harmonize dtypes before concatenation in lp file writing to avoid dtype mismatch errors. This error occurred when creating and storing models in netcdf format using windows machines and loading and solving them on linux machines.
12+
* Fix expression merge to explicitly use outer join when combining expressions with disjoint coordinates for consistent behavior across xarray versions
1213

1314
Version 0.5.6
1415
--------------

linopy/expressions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,6 +1999,8 @@ def merge(
19991999

20002000
if override:
20012001
kwargs["join"] = "override"
2002+
else:
2003+
kwargs.setdefault("join", "outer")
20022004

20032005
if dim == TERM_DIM:
20042006
ds = xr.concat([d[["coeffs", "vars"]] for d in data], dim, **kwargs)

0 commit comments

Comments
 (0)