From 7a2f07e135e8d9a699516d6f3b58ce5cb877d53a Mon Sep 17 00:00:00 2001 From: Parisra <102019906+Parisra@users.noreply.github.com> Date: Mon, 29 Apr 2024 14:33:51 +0200 Subject: [PATCH] Fix component index error The list of carriers for adjust_renewable_profiles is read from config['electricity']['renewable_carriers'] which includes 'solar-hsat' and would result in 'Components Index(['AL0 0 solar-hsat',...) for attribute p_max_pu of Generator are not in main components dataframe generators' warning for the myopic run if the solar tracking option is false. --- scripts/add_brownfield.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/add_brownfield.py b/scripts/add_brownfield.py index 16b4e087..17f19c29 100644 --- a/scripts/add_brownfield.py +++ b/scripts/add_brownfield.py @@ -201,6 +201,8 @@ def adjust_renewable_profiles(n, input_profiles, params, year): for carrier in params["carriers"]: if carrier == "hydro": continue + if carrier =='solar-hsat' and not snakemake.config['sector']['solar_utility_singla_axis_tracking']: + continue with xr.open_dataset(getattr(input_profiles, "profile_" + carrier)) as ds: if ds.indexes["bus"].empty or "year" not in ds.indexes: continue