Merge pull request #340 from PyPSA/skip-if-no-lv

skip iterations if no lines are expandable
This commit is contained in:
Fabian Neumann 2022-03-25 13:46:14 +01:00 committed by GitHub
commit 297ae04d5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -62,6 +62,8 @@ Upcoming Release
* New network topology extracted from the ENTSO-E interactive map.
* Iterative solving with impedance updates is skipped if there are no expandable lines.
* Switch from Germany to Belgium for continuous integration and tutorial to save resources.
* Use updated SARAH-2 and ERA5 cutouts with slightly wider scope to east and additional variables.

View File

@ -254,7 +254,12 @@ def solve_network(n, config, opts='', **kwargs):
n.config = config
n.opts = opts
if cf_solving.get('skip_iterations', False):
skip_iterations = cf_solving.get('skip_iterations', False)
if not n.lines.s_nom_extendable.any():
skip_iterations = True
logger.info("No expandable lines found. Skipping iterative solving.")
if skip_iterations:
network_lopf(n, solver_name=solver_name, solver_options=solver_options,
extra_functionality=extra_functionality, **kwargs)
else: