Skip to content

Commit

Permalink
gen shares adjustments for headline metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbrinkerink committed Dec 11, 2024
1 parent 51315c5 commit 1970942
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions workflow/scripts/osemosys_global/summary/headline.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def _filter_pwr_techs(
"""

df = production_by_technology.copy()
df = df.loc[df.index.get_level_values("FUEL").str.startswith('ELC')]

df = df[
(df.index.get_level_values("TECHNOLOGY").str.startswith("PWR"))
Expand All @@ -71,6 +72,7 @@ def _filter_techs(
) -> pd.DataFrame:

df = production_by_technology.copy()
df = df.loc[df.index.get_level_values("FUEL").str.startswith('ELC')]
df["tech"] = df.index.get_level_values("TECHNOLOGY").str[0:6]

techs = [f"PWR{x}" for x in carriers]
Expand All @@ -83,11 +85,14 @@ def _filter_techs(
def get_gen_shares(
production_by_technology: pd.DataFrame, exclusions: Optional[list[str]] = None
) -> pd.DataFrame:

df = production_by_technology.copy()
df = df.loc[df.index.get_level_values("FUEL").str.startswith('ELC')]

gen_total = _filter_pwr_techs(production_by_technology, exclusions).VALUE.sum()
rnw_total = _filter_techs(production_by_technology, RENEWABLES).VALUE.sum()
fsl_total = _filter_techs(production_by_technology, FOSSIL).VALUE.sum()
cln_total = _filter_techs(production_by_technology, CLEAN).VALUE.sum()
gen_total = _filter_pwr_techs(df, exclusions).VALUE.sum()
rnw_total = _filter_techs(df, RENEWABLES).VALUE.sum()
fsl_total = _filter_techs(df, FOSSIL).VALUE.sum()
cln_total = _filter_techs(df, CLEAN).VALUE.sum()

rnw_share = round((rnw_total / gen_total) * 100, 0)
fsl_share = round((fsl_total / gen_total) * 100, 0)
Expand Down

0 comments on commit 1970942

Please sign in to comment.