Fix creation of renewable profiles for offshore wind. (#255)

* Update build_renewable_profiles.py

* Update release_notes.rst

* Update release_notes.rst

* Update release_notes.rst

* Update scripts/build_renewable_profiles.py

Co-authored-by: FabianHofmann <hofmann@fias.uni-frankfurt.de>

* Adjust doc string

Co-authored-by: FabianHofmann <hofmann@fias.uni-frankfurt.de>
Co-authored-by: Fabian <fab.hof@gmx.de>
This commit is contained in:
euronion 2021-06-28 16:20:29 +02:00 committed by GitHub
parent 094afc8c50
commit 8654077519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,5 @@
.. ..
SPDX-FileCopyrightText: 2019-2020 The PyPSA-Eur Authors SPDX-FileCopyrightText: 2019-2021 The PyPSA-Eur Authors
SPDX-License-Identifier: CC-BY-4.0 SPDX-License-Identifier: CC-BY-4.0
@ -23,6 +23,7 @@ Upcoming Release
* Bugfix in :mod:`solve_operations_network`: optimised capacities are now fixed for all extendable links, not only HVDC links [`#244 <https://github.com/PyPSA/pypsa-eur/pull/244>`_]. * Bugfix in :mod:`solve_operations_network`: optimised capacities are now fixed for all extendable links, not only HVDC links [`#244 <https://github.com/PyPSA/pypsa-eur/pull/244>`_].
* The ``focus_weights`` are now also considered when pre-clustering in the :mod:`simplify_network` rule [`#241 <https://github.com/PyPSA/pypsa-eur/pull/241>`_]. * The ``focus_weights`` are now also considered when pre-clustering in the :mod:`simplify_network` rule [`#241 <https://github.com/PyPSA/pypsa-eur/pull/241>`_].
* Continuous integration testing switches to Github Actions from Travis CI [`#252 <https://github.com/PyPSA/pypsa-eur/pull/252>`_]. * Continuous integration testing switches to Github Actions from Travis CI [`#252 <https://github.com/PyPSA/pypsa-eur/pull/252>`_].
* Bugfix in :mod:`build_renewable_profile` where offshore wind profiles could no longer be created [`#249 <https://github.com/PyPSA/pypsa-eur/pull/249>`_].
PyPSA-Eur 0.3.0 (7th December 2020) PyPSA-Eur 0.3.0 (7th December 2020)
================================== ==================================

View File

@ -183,6 +183,7 @@ import progressbar as pgb
import geopandas as gpd import geopandas as gpd
import xarray as xr import xarray as xr
import numpy as np import numpy as np
import functools
import atlite import atlite
import logging import logging
from pypsa.geo import haversine from pypsa.geo import haversine
@ -235,7 +236,10 @@ if __name__ == '__main__':
excluder.add_raster(paths.corine, codes=codes, buffer=buffer, crs=3035) excluder.add_raster(paths.corine, codes=codes, buffer=buffer, crs=3035)
if "max_depth" in config: if "max_depth" in config:
func = lambda v: v <= -config['max_depth'] # lambda not supported for atlite + multiprocessing
# use named function np.greater with partially frozen argument instead
# and exclude areas where: -max_depth > grid cell depth
func = functools.partial(np.greater,-config['max_depth'])
excluder.add_raster(paths.gebco, codes=func, crs=4236, nodata=-1000) excluder.add_raster(paths.gebco, codes=func, crs=4236, nodata=-1000)
if 'min_shore_distance' in config: if 'min_shore_distance' in config: