Skip to content

Commit

Permalink
Merge branch 'main' into industry_workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hazemakhalek authored Nov 15, 2023
2 parents 10f15c7 + 5fe2c2a commit dd998fe
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 739 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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ exclude: ^(LICENSES|README.md)

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-merge-conflict
- id: end-of-file-fixer
Expand All @@ -36,7 +36,7 @@ repos:

# Formatting with "black" coding style
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 23.10.1
hooks:
# Format Python files
- id: black
Expand All @@ -45,7 +45,7 @@ repos:

# Do YAML formatting (before the linter checks it for misses)
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.10.0
rev: v2.11.0
hooks:
- id: pretty-format-yaml
args: [--autofix, --indent, '2', --preserve-quotes]
Expand All @@ -59,7 +59,7 @@ repos:

# Format Snakemake rule / workflow files
- repo: https://github.com/snakemake/snakefmt
rev: v0.8.4
rev: v0.8.5
hooks:
- id: snakefmt

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
9 changes: 7 additions & 2 deletions config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,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 @@ -58,7 +61,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 @@ -78,7 +81,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 Expand Up @@ -275,7 +280,7 @@ sector:
space_heat_share: 0.6 # the share of space heating from all heating. Remainder goes to water heating.
airport_sizing_factor: 3


min_part_load_fischer_tropsch: 0.9

conventional_generation: # generator : carrier
OCGT: gas
Expand Down
195 changes: 0 additions & 195 deletions data/costs.csv

This file was deleted.

Loading

0 comments on commit dd998fe

Please sign in to comment.