Skip to content

Commit 3365684

Browse files
committed
adjust DEA 2015 for inflation
1 parent e9e2087 commit 3365684

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

scripts/compile_cost_assumptions.py

+15-10
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,8 @@ def add_desalinsation_data(costs):
507507
costs.loc[(tech, 'lifetime'), 'unit'] = "years"
508508
costs.loc[(tech, 'lifetime'), 'source'] = source_dict['Caldera2016'] + ", Table 1."
509509

510-
costs = adjust_for_inflation(costs, ['seawater desalination'], 2015)
511-
costs = adjust_for_inflation(costs, ['clean water tank storage'], 2013)
510+
costs = adjust_for_inflation(costs, ['seawater desalination'], 2015, ["value"])
511+
costs = adjust_for_inflation(costs, ['clean water tank storage'], 2013, ["value"])
512512

513513
return costs
514514

@@ -633,7 +633,7 @@ def get_data_from_DEA(data_in, expectation=None):
633633

634634
return d_by_tech
635635

636-
def adjust_for_inflation(costs, techs, ref_year):
636+
def adjust_for_inflation(costs, techs, ref_year, col):
637637
"""
638638
adjust the investment costs for the specified techs for inflation.
639639
@@ -646,9 +646,10 @@ def adjust_for_inflation(costs, techs, ref_year):
646646
"""
647647

648648
inflation = (1 + snakemake.config['rate_inflation'])**(ref_year - snakemake.config['eur_year'])
649-
paras = ["investment", "VOM", "fixed"]
649+
paras = ["investment", "VOM", "fixed", "fuel"]
650650
filter_i = costs.index.get_level_values(0).isin(techs) & costs.index.get_level_values(1).isin(paras)
651-
costs.loc[filter_i, 'value'] /= inflation
651+
652+
costs.loc[filter_i, col] = costs.loc[filter_i, col].div(inflation.loc[filter_i], axis=0)
652653

653654

654655
return costs
@@ -1277,7 +1278,7 @@ def add_manual_input(data):
12771278
df = pd.read_csv(snakemake.input['manual_input'], quotechar='"',sep=',', keep_default_na=False)
12781279
df = df.rename(columns={"further_description": "further description"})
12791280

1280-
# Inflation adjustment for investment and VOM
1281+
# Inflation adjustment
12811282
mask = df[df['parameter'].isin(['investment','VOM','fuel'])].index
12821283
df.loc[mask, 'value'] /= (1+snakemake.config['rate_inflation'])**(df.loc[mask, 'currency_year'].astype(int)-snakemake.config['eur_year'])
12831284

@@ -2109,7 +2110,12 @@ def geometric_series(nominator, denominator=1, number_of_terms=1, start=1):
21092110
data = add_gas_storage(data)
21102111
# add carbon capture
21112112
data = add_carbon_capture(data, tech_data)
2112-
2113+
2114+
# adjust for inflation
2115+
data["currency_year"] = [2015 if x not in new_format else 2020 for x in
2116+
data.index.get_level_values(0)]
2117+
techs = data.index.get_level_values(0)
2118+
data = adjust_for_inflation(data, techs, data.currency_year, years)
21132119

21142120
# %% (2) -- get data from other sources which need formatting -----------------
21152121
# (a) ---------- get old pypsa costs ---------------------------------------
@@ -2177,17 +2183,16 @@ def geometric_series(nominator, denominator=1, number_of_terms=1, start=1):
21772183
solar_techs = ['solar', 'solar-rooftop', 'solar-rooftop commercial',
21782184
'solar-rooftop residential',
21792185
'solar-utility', 'solar-utility single-axis tracking']
2180-
costs = adjust_for_inflation(costs, solar_techs, 2020)
2186+
21812187

21822188
# adjust for inflation all techs in new DEA format
21832189
new_format_without_solar = [tech for tech in new_format if tech not in solar_techs]
2184-
costs = adjust_for_inflation(costs, new_format_without_solar, 2020)
21852190
# add desalination and clean water tank storage
21862191
costs = add_desalinsation_data(costs)
21872192
# add energy storage database
21882193
if snakemake.config['energy_storage_database']['pnnl_energy_storage'].get("add_data", True):
21892194
costs, tech = add_energy_storage_database(costs, year)
2190-
costs = adjust_for_inflation(costs, tech, 2020)
2195+
costs = adjust_for_inflation(costs, tech, 2020, ["value"])
21912196

21922197
# add electrolyzer and fuel cell efficiency from other source than DEA
21932198
if snakemake.config["energy_storage_database"].get("h2_from_budischak", True):

0 commit comments

Comments
 (0)