Skip to content

Commit

Permalink
Merge pull request #123 from PyPSA/cost-2020-update
Browse files Browse the repository at this point in the history
Cost 2020 update
  • Loading branch information
lisazeyen committed Feb 28, 2024
2 parents 3557d4e + d680992 commit 68bde67
Show file tree
Hide file tree
Showing 8 changed files with 787 additions and 757 deletions.
214 changes: 107 additions & 107 deletions outputs/costs_2020.csv

Large diffs are not rendered by default.

214 changes: 107 additions & 107 deletions outputs/costs_2025.csv

Large diffs are not rendered by default.

214 changes: 107 additions & 107 deletions outputs/costs_2030.csv

Large diffs are not rendered by default.

214 changes: 107 additions & 107 deletions outputs/costs_2035.csv

Large diffs are not rendered by default.

214 changes: 107 additions & 107 deletions outputs/costs_2040.csv

Large diffs are not rendered by default.

214 changes: 107 additions & 107 deletions outputs/costs_2045.csv

Large diffs are not rendered by default.

214 changes: 107 additions & 107 deletions outputs/costs_2050.csv

Large diffs are not rendered by default.

46 changes: 38 additions & 8 deletions scripts/compile_cost_assumptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,38 @@
# since February 2022 DEA uses a new format for the technology data
# all excel sheets of updated technologies have a different layout and are
# given in EUR_2020 money (instead of EUR_2015)
new_format = ['solar-utility',
cost_year_2020 = ['solar-utility',
'solar-utility single-axis tracking',
'solar-rooftop residential',
'solar-rooftop commercial',
'offwind',
'electrolysis']
'electrolysis',
'biogas',
'biogas CC',
'biogas upgrading',
'direct air capture',
'biomass CHP capture',
'cement capture',
'BioSNG',
'BtL',
'biomass-to-methanol',
'biogas plus hydrogen',
'methanolisation',
'Fischer-Tropsch'
]

cost_year_2019 = ['direct firing gas',
'direct firing gas CC',
'direct firing solid fuels',
'direct firing solid fuels CC',
'industrial heat pump medium temperature',
'industrial heat pump high temperature',
'electric boiler steam',
'gas boiler steam',
'solid biomass boiler steam',
'solid biomass boiler steam CC',
]


# %% -------- FUNCTIONS ---------------------------------------------------

Expand Down Expand Up @@ -273,7 +299,7 @@ def get_data_DEA(tech, data_in, expectation=None):
usecols += f",{uncrtnty_lookup[tech]}"


if (tech in new_format) or ("renewable_fuels" in excel_file):
if ((tech in cost_year_2019) or (tech in cost_year_2020) or ("renewable_fuels" in excel_file)):
skiprows = [0]
else:
skiprows = [0,1]
Expand Down Expand Up @@ -454,7 +480,7 @@ def get_data_DEA(tech, data_in, expectation=None):
df_final = df_final.ffill(axis=1)

df_final["source"] = source_dict["DEA"] + ", " + excel_file.replace("inputs/","")
if tech in new_format and (tech!="electrolysis"):
if tech in cost_year_2020 and (not ("for_carbon_capture_transport_storage" in excel_file)) and (not ("renewable_fuels" in excel_file)):
for attr in ["investment", "Fixed O&M"]:
to_drop = df[df.index.str.contains(attr) &
~df.index.str.contains("\(\*total\)")].index
Expand Down Expand Up @@ -2184,9 +2210,13 @@ def prepare_inflation_rate(fn):
data = add_carbon_capture(data, tech_data)

# adjust for inflation
data["currency_year"] = [2015 if x not in new_format else 2020 for x in
data.index.get_level_values(0)]

for x in data.index.get_level_values("technology"):
if x in cost_year_2020:
data.at[x, "currency_year"] = 2020
elif x in cost_year_2019:
data.at[x, "currency_year"] = 2019
else:
data.at[x, "currency_year"] = 2015

# %% (2) -- get data from other sources which need formatting -----------------
# (a) ---------- get old pypsa costs ---------------------------------------
Expand Down Expand Up @@ -2321,4 +2351,4 @@ def prepare_inflation_rate(fn):
costs_tot.sort_index(inplace=True)
costs_tot.loc[:,'value'] = round(costs_tot.value.astype(float),
snakemake.config.get("ndigits", 2))
costs_tot.to_csv([v for v in snakemake.output if str(year) in v][0])
costs_tot.to_csv([v for v in snakemake.output if str(year) in v][0])

0 comments on commit 68bde67

Please sign in to comment.