From 4cd492bb6f10a4e50ef86de45cc42e40314958e0 Mon Sep 17 00:00:00 2001 From: lisazeyen Date: Mon, 28 Aug 2023 13:52:55 +0200 Subject: [PATCH] drop assets which reached end of lifetime --- scripts/add_existing_baseyear.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/add_existing_baseyear.py b/scripts/add_existing_baseyear.py index 4e6caaaa..782fde78 100644 --- a/scripts/add_existing_baseyear.py +++ b/scripts/add_existing_baseyear.py @@ -607,6 +607,10 @@ def add_heating_capacities_installed_before_baseyear( if str(grouping_year) in index and n.links.p_nom[index] < threshold ], ) + + # drop assets which are at the end of their lifetime + links_i = n.links[(n.links.build_year+n.links.lifetime<=baseyear)].index + n.mremove("Link", links_i) # %% @@ -621,7 +625,7 @@ if __name__ == "__main__": clusters="37", ll="v1.0", opts="", - sector_opts="8760H-T-H-B-I-A-solar+p3-dist1", + sector_opts="1p7-4380H-T-H-B-I-A-solar+p3-dist1", planning_horizons=2020, )