Skip to content

Commit

Permalink
fix #147
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianHofmann committed Jun 7, 2021
1 parent 1476c43 commit d70a7a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions RELEASE_NOTES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Release Notes
Upcoming Release
=================

* Fix cutout merge and update for xarray ``>=v0.18.0`` (https://github.com/PyPSA/atlite/issues/147)

Version 0.2.3
==============

Expand Down
5 changes: 3 additions & 2 deletions atlite/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ def cutout_prepare(cutout, features=None, tmpdir=None, overwrite=False):
prepared |= set(missing_features)

cutout.data.attrs.update(dict(prepared_features=list(prepared)))
ds = (cutout.data.merge(ds[missing_vars.values])
.assign_attrs(**non_bool_dict(cutout.data.attrs), **ds.attrs))
attrs = non_bool_dict(cutout.data.attrs)
attrs.update(ds.attrs)
ds = (cutout.data.merge(ds[missing_vars.values]).assign_attrs(**attrs))

# write data to tmp file, copy it to original data, this is much safer
# than appending variables
Expand Down

0 comments on commit d70a7a5

Please sign in to comment.