Skip to content

Commit

Permalink
Merge pull request #201 from OSeMOSYS/peak-load-factor-del
Browse files Browse the repository at this point in the history
Remove Peak Load Ratio from Demand Projections
  • Loading branch information
trevorb1 authored Sep 21, 2024
2 parents 2d745c4 + e4b4dfe commit 67c5160
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
7 changes: 2 additions & 5 deletions workflow/scripts/osemosys_global/demand/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
GDP_PPP_COUNTRIES_SOURCE = "OECD Env-Growth" # Options are 'IIASA GDP' and 'OECD Env-Growth'. 'OECD Env-Growth' has more entries.
URB_COUNTRIES_SOURCE = "NCAR" #'NCAR' is the only option.

# Peak to total demand ratio
PEAK_RATIO_FACTOR = 1

# Projection range
# Projection range
START_YEAR = 2010
END_YEAR = 2100
END_YEAR = 2100
24 changes: 1 addition & 23 deletions workflow/scripts/osemosys_global/demand/projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pandas as pd
import numpy as np
from regression import get_regression_coefficients
from constants import START_YEAR, END_YEAR, PEAK_RATIO_FACTOR
from constants import START_YEAR, END_YEAR
from spatial import get_spatial_mapping_country, get_spatial_mapping_node
from data import get_nodal_plexos_demand

Expand All @@ -28,10 +28,8 @@ def perform_node_projections(
df = perform_node_projection_step(
lr, plexos, plexos_demand, iamc_gdp, iamc_pop, iamc_urb, td_losses
)

proj = _interpolate_yearly_demand(df)
proj = _get_node_peak_demand_ratio(plexos_demand, proj)
# return _adjust_with_peak_demand(proj, PEAK_RATIO_FACTOR)
return proj


Expand Down Expand Up @@ -342,23 +340,3 @@ def _get_node_peak_demand_ratio(
.set_index("PLEXOS_Nodes")
.drop(columns={"Share_%_Country_Demand"})
)


def _adjust_with_peak_demand(
projection: pd.DataFrame, peak_ratio_factor: float
) -> pd.DataFrame:
"""Calculates projected hourly peak demand by using the relative 2015 peak demand as proxy.
The peak to total demand ratio can be adjusted by changing the peak_ratio_factor.
"""

df = projection.copy()

for year in range(START_YEAR, 2101): # TODO fix this to END_YEAR
df[year] = (
df[year] * peak_ratio_factor * df["Ratio_Peak/Total_Demand_2015"] * 1000
).round(2)

df["Unit"] = "MW"

return df

0 comments on commit 67c5160

Please sign in to comment.