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.
This commit is contained in:
Parisra 2024-04-29 14:33:51 +02:00 committed by GitHub
parent 17b3e1677d
commit 7a2f07e135
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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