Skip to content

Commit

Permalink
Merge pull request #239 from pypsa-meets-earth/retrieve_costs
Browse files Browse the repository at this point in the history
Retrieve costs automatically
  • Loading branch information
hazemakhalek authored Nov 8, 2023
2 parents 71134d2 + 6717b41 commit a9847d9
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 732 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ data/energy_totals_NZ_2030.csv
gadm_shapes.geojson
data/energy_totals_NZ_2030
data/industry_sector_ratios_NZ_2030.csv
data/costs*

# Folders
/bak
Expand Down
19 changes: 18 additions & 1 deletion Snakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from os.path import exists
from shutil import copyfile
from shutil import copyfile, move

from snakemake.remote.HTTP import RemoteProvider as HTTPRemoteProvider

Expand Down Expand Up @@ -46,6 +46,23 @@ subworkflow pypsaearth:
"./config.pypsa-earth.yaml"


if config["enable"].get("retrieve_cost_data", True):

rule retrieve_cost_data:
input:
HTTP.remote(
f"raw.githubusercontent.com/PyPSA/technology-data/{config['costs']['version']}/outputs/costs"
+ "_{planning_horizons}.csv",
keep_local=True,
),
output:
costs=CDIR + "costs_{planning_horizons}.csv",
resources:
mem_mb=5000,
run:
move(input[0], output[0])


rule prepare_sector_networks:
input:
expand(
Expand Down
7 changes: 6 additions & 1 deletion config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ H2_network: false
H2_network_limit: 2000 #GWkm
H2_repurposed_network: false

enable:
retrieve_cost_data: true # if true, the workflow overwrites the cost data saved in data/costs again

fossil_reserves:
oil: 100 #TWh Maybe reduntant

Expand All @@ -56,7 +59,7 @@ hydrogen_underground_storage: false
export:
h2export: [120] # Yearly export demand in TWh
store: true # [True, False] # specifies wether an export store to balance demand is implemented
store_capital_costs: "no_costs" # ["standard_costs", "no_costs"] # specifies the costs of the export store. "standard_costs" takes CAPEX of "hydrogen storage tank incl. compressor"
store_capital_costs: "no_costs" # ["standard_costs", "no_costs"] # specifies the costs of the export store. "standard_costs" takes CAPEX of "hydrogen storage tank type 1 including compressor"
export_profile: "ship" # use "ship" or "constant"
ship:
ship_capacity: 0.4 # TWh # 0.05 TWh for new ones, 0.003 TWh for Susio Frontier, 0.4 TWh according to Hampp2021: "Corresponds to 11360 t H2 (l) with LHV of 33.3333 Mwh/t_H2. Cihlar et al 2020 based on IEA 2019, Table 3-B"
Expand All @@ -76,7 +79,9 @@ custom_data:
custom_sectors: false
gas_grid: false

# Costs used in PyPSA-Earth-Sec. Year depends on the wildcard "planning_horizon" in the scenario section
costs:
version: v0.6.2
lifetime: 25 #default lifetime
# From a Lion Hirth paper, also reflects average of Noothout et al 2016
discountrate: [0.071] #, 0.086, 0.111]
Expand Down
195 changes: 0 additions & 195 deletions data/costs.csv

This file was deleted.

Loading

0 comments on commit a9847d9

Please sign in to comment.