Skip to content

Commit

Permalink
it runs finally
Browse files Browse the repository at this point in the history
  • Loading branch information
Timon-R committed Dec 16, 2024
1 parent 8b7e9e7 commit 5f9a0a3
Show file tree
Hide file tree
Showing 10 changed files with 2,449 additions and 2,331 deletions.
5 changes: 4 additions & 1 deletion Snakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

# snakemake -call compile_cost_assumptions --configfile config.yaml

configfile: "config.yaml"


Expand All @@ -20,7 +22,8 @@ rule compile_cost_assumptions:
dea_ship = "inputs/data_sheets_for_maritime_commercial_freight_and_passenger_transport.xlsx",
dea_ccts = "inputs/technology_data_for_carbon_capture_transport_storage.xlsx",
pnnl_energy_storage = "inputs/pnnl-energy-storage-database.xlsx",
manual_input = "inputs/manual_input.csv"
manual_input = "inputs/manual_input.csv",
enspreso = "inputs/ENSPRESO_BIOMASS.xlsx"
output:
expand("outputs/costs_{year}.csv", year = config["years"])
threads: 1
Expand Down
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ years : [2020, 2025, 2030, 2035, 2040, 2045, 2050]
expectation : "" # tech data uncertainty, possible options [None, "optimist", "pessimist"]

#year for EUR outputs
eur_year : 2020
eur_year : 2010

# add solar from different source
solar_utility_from_vartiaien : false
Expand Down
678 changes: 347 additions & 331 deletions outputs/costs_2020.csv

Large diffs are not rendered by default.

678 changes: 347 additions & 331 deletions outputs/costs_2025.csv

Large diffs are not rendered by default.

678 changes: 347 additions & 331 deletions outputs/costs_2030.csv

Large diffs are not rendered by default.

678 changes: 347 additions & 331 deletions outputs/costs_2035.csv

Large diffs are not rendered by default.

678 changes: 347 additions & 331 deletions outputs/costs_2040.csv

Large diffs are not rendered by default.

678 changes: 347 additions & 331 deletions outputs/costs_2045.csv

Large diffs are not rendered by default.

678 changes: 347 additions & 331 deletions outputs/costs_2050.csv

Large diffs are not rendered by default.

27 changes: 15 additions & 12 deletions scripts/compile_cost_assumptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,11 +762,11 @@ def get_data_DEA(tech, data_in, expectation=None):

return df_final

def add_biomass_costs(costs):
def add_biomass_costs(enspreso, data):
# Scenarios: ENS_Low, ENS_Med, ENS_High
# Years: 2010, 2020, ... , 2050

database_file = "inputs/ENSPRESO_database.xlsx"
database_file = enspreso
scenario = "ENS_High"
year = 2050

Expand Down Expand Up @@ -826,18 +826,20 @@ def add_biomass_costs(costs):

# Define the new technology data
parameter = 'fuel'
unit = 'Euro2010/MWh_th'
unit = 'Euro/MWh_th'
source = 'Weighted average costs from JLC ENSPRESO, scenario ENS_High, year 2050'
description = 'Weighted by country potentials'
currency_year = 2010

for row in weighted_avg_costs.iterrows():
costs.loc[(row['Energy Commodity'], parameter), 'value'] = row['Weighted_Average_Cost']
costs.loc[(row['Energy Commodity'], parameter), 'unit'] = unit
costs.loc[(row['Energy Commodity'], parameter), 'source'] = source
costs.loc[(row['Energy Commodity'], parameter), 'further description'] = description
costs.loc[(row['Energy Commodity'], parameter), 'currency_year'] = currency_year
return costs
for _, row in weighted_avg_costs.iterrows():
index = (row['Energy Commodity'], parameter)
data.loc[index, 'value'] = row['Weighted_Average_Cost']
data.loc[index, 'unit'] = unit
data.loc[index, 'source'] = source
data.loc[index, 'further description'] = description
data.loc[index, 'currency_year'] = currency_year

return data


def add_desalinsation_data(costs):
Expand Down Expand Up @@ -2778,8 +2780,6 @@ def prepare_inflation_rate(fn):
costs.loc[('digestible biomass', 'fuel'), 'source'] = "JRC ENSPRESO ca avg for MINBIOAGRW1, ENS_Ref for 2040"
costs.loc[('digestible biomass', 'fuel'), 'currency_year'] = 2010

costs = add_biomass_costs(costs)

# add solar data from other source than DEA
if any([snakemake.config['solar_utility_from_vartiaien'], snakemake.config['solar_rooftop_from_etip']]):
costs = add_solar_from_other(costs)
Expand All @@ -2798,6 +2798,9 @@ def prepare_inflation_rate(fn):
# CO2 intensity
costs = add_co2_intensity(costs)

#add costs for biomass
costs = add_biomass_costs(snakemake.input.enspreso, costs)

# carbon balances
costs = carbon_flow(costs,year)

Expand Down

0 comments on commit 5f9a0a3

Please sign in to comment.