From 573cad190fad550791c6ead0406196334033dc37 Mon Sep 17 00:00:00 2001 From: lisazeyen Date: Thu, 7 Mar 2024 10:11:51 +0100 Subject: [PATCH] correct naming --- scripts/add_existing_baseyear.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/add_existing_baseyear.py b/scripts/add_existing_baseyear.py index f69235e58..9a0fc22cd 100644 --- a/scripts/add_existing_baseyear.py +++ b/scripts/add_existing_baseyear.py @@ -84,7 +84,8 @@ def add_existing_land_transport(baseyear, options): df["build_year"] = build_year df["p_nom"] = share * p_nom df["p_nom_extendable"] = False - df.rename(index=lambda x: x + f"-{build_year}", inplace=True) + df.rename(index=lambda x: x.replace(f"-{baseyear}", f"-{build_year}"), + inplace=True) n.madd( "Link", @@ -101,7 +102,8 @@ def add_existing_land_transport(baseyear, options): p_max_pu=p_max_pu, lifetime=df.lifetime, ) - + + n.links.loc[ice_i, "p_nom"] = 0 def add_existing_renewables(df_agg): """