Conditional to avoid error if  instead of a dictionary
@@ -511,6 +511,9 @@ def load_usr_demand_profiles(settings):
regional_load_sources = settings.get("regional_load_source")
if regional_load_sources is not None:
+ if regional_load_sources == "USER":
+ cols = settings.get("model_regions")
+ else:
cols = regional_load_sources.get("USER")
if not all([col in hourly_load_profiles.columns for col in cols]):
raise KeyError(
