wrap demand response in if not None
@@ -1906,6 +1906,7 @@ class GeneratorClusters:
df_list = []
self.demand_response_profiles = {}
+ if self.settings["demand_response_resources"] is not None:
for resource, parameters in self.settings["demand_response_resources"][
year
].items():
@@ -1923,7 +1924,9 @@ class GeneratorClusters:
/ self.settings["input_folder"]
/ self.settings["demand_response_fn"]
)
- dr_profile = make_demand_response_profiles(dr_path, resource, self.settings)
+ dr_profile = make_demand_response_profiles(
+ dr_path, resource, self.settings
+ )
self.demand_response_profiles[resource] = dr_profile
dr_capacity = demand_response_resource_capacity(
@@ -1943,6 +1946,8 @@ class GeneratorClusters:
dr_rows["Fuel"] = "None"
dr_rows["cluster"] = 1
dr_rows = dr_rows.fillna(0)
+ else:
+ dr_rows = pd.DataFrame()
return dr_rows
