Skip to content

fix: use xarray.Dataset copy instead of constructor#647

Open
maurerle wants to merge 3 commits intoPyPSA:masterfrom
maurerle:xarray_update
Open

fix: use xarray.Dataset copy instead of constructor#647
maurerle wants to merge 3 commits intoPyPSA:masterfrom
maurerle:xarray_update

Conversation

@maurerle
Copy link
Copy Markdown
Contributor

minimal non-working example:

import pypsa
network = pypsa.examples.ac_dc_meshed()
network.optimize()

Changes proposed in this Pull Request

since the latest xarray version, passing a Dataset as data_vars to the Dataset constructor is not supported. Use ds.copy() to create a copy of a Dataset.

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

since the latest xarray version, passing a Dataset as `data_vars` to the Dataset constructor is not supported. Use `ds.copy()` to create a copy of a Dataset.
this results in failing CI and wrong results otherwise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant