Formatting and other minor changes
Add short docstring for fn loading user demand profiles.
Change how dictionary keys are accessed.
@@ -165,34 +165,37 @@ def subtract_distributed_generation(load_curves, pudl_engine, settings):
return load_curves
+
def load_usr_demand_profiles(settings):
+ "Temp function to load user-generated demand profiles"
lp_path = settings["input_folder"] / settings["regional_load_fn"]
- hourly_load_profiles = pd.read_csv(lp_path, index_col='region')
+ hourly_load_profiles = pd.read_csv(lp_path, index_col="region")
return hourly_load_profiles
+
def make_final_load_curves(
pudl_engine,
settings,
pudl_table="load_curves_epaipm",
settings_agg_key="region_aggregations",
):
- if settings["regional_load_fn"] is not None:
+ if settings.get("regional_load_fn"):
load_curves_dr = load_usr_demand_profiles(settings)
else:
load_curves_before_dg = make_load_curves(
pudl_engine, settings, pudl_table, settings_agg_key
)
- if "demand_response_fn" in settings.keys():
+ if settings.get("demand_response_fn"):
load_curves_dr = add_demand_response_resource_load(
load_curves_before_dg, settings
)
else:
load_curves_dr = load_curves_before_dg
- if "distributed_gen_profiles_fn" in settings.keys():
+ if settings.get("distributed_gen_profiles_fn"):
final_load_curves = subtract_distributed_generation(
load_curves_dr, pudl_engine, settings
)
