From 5b9f64354fb8cb6a8d9bfca361b5397347309ab3 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Wed, 18 Aug 2021 12:17:31 +0200 Subject: [PATCH] xarray 0.19 compatibility (#158) --- doc/release_notes.rst | 1 + scripts/build_population_layouts.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 15419438..016e19dc 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -66,6 +66,7 @@ Future release * The share of shipping transformed into hydrogen fuel cell can be now defined for different years in the ``config.yaml`` file. The carbon emission from the remaining share is treated as a negative load on the atmospheric carbon dioxide bus, just like aviation and land transport emissions. * The transformation of the Steel and Aluminium production can be now defined for different years in the ``config.yaml`` file. * Include the option to alter the maximum energy capacity of a store via the ``carrier+factor`` in the ``{sector_opts}`` wildcard. This can be useful for sensitivity analyses. Example: ``co2 stored+e2`` multiplies the ``e_nom_max`` by factor 2. In this example, ``e_nom_max`` represents the CO2 sequestration potential in Europe. +* Compatibility with ``xarray`` version 0.19. PyPSA-Eur-Sec 0.5.0 (21st May 2021) =================================== diff --git a/scripts/build_population_layouts.py b/scripts/build_population_layouts.py index 57934fb2..6c229797 100644 --- a/scripts/build_population_layouts.py +++ b/scripts/build_population_layouts.py @@ -90,8 +90,8 @@ if __name__ == '__main__': for key, pop in pop_cells.items(): - ycoords = ('y', cutout.coords['y']) - xcoords = ('x', cutout.coords['x']) + ycoords = ('y', cutout.coords['y'].data) + xcoords = ('x', cutout.coords['x'].data) values = pop.values.reshape(cutout.shape) layout = xr.DataArray(values, [ycoords, xcoords])