From 1496c585d03b60a1992a350a942872eb867a76a9 Mon Sep 17 00:00:00 2001 From: Thomas Gilon Date: Thu, 14 Mar 2024 16:56:00 +0100 Subject: [PATCH] Fix duplicated years in add_land_use_constraint_m --- doc/release_notes.rst | 2 ++ scripts/solve_network.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/release_notes.rst b/doc/release_notes.rst index ad1bbf4f..5682d788 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -106,6 +106,8 @@ Upcoming Release * Adapt the disabling of transmission expansion in myopic foresight optimisations when limit is already reached to also handle cost limits. +* Fix duplicated years in `add_land_use_constraint_m`. + PyPSA-Eur 0.10.0 (19th February 2024) ===================================== diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 7e53e606..7adf492a 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -165,7 +165,7 @@ def _add_land_use_constraint_m(n, planning_horizons, config): previous_years = [ str(y) - for y in planning_horizons + grouping_years + for y in set(planning_horizons + grouping_years) if y < int(snakemake.wildcards.planning_horizons) ]