Skip to content

Commit

Permalink
Merge branch 'main' into 234-modify-copy-commit-processing-rule
Browse files Browse the repository at this point in the history
  • Loading branch information
davide-f authored Nov 24, 2023
2 parents c320b01 + 071f9ea commit 248b9f8
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 754 deletions.
3 changes: 2 additions & 1 deletion .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 Expand Up @@ -54,7 +55,7 @@ doc/_build
/sample_pypsa_eur

/notebooks

/slurm
# File extensions
*.org
*.nc
Expand Down
10 changes: 5 additions & 5 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.11.0
hooks:
# Format Python files
- id: black
Expand All @@ -45,21 +45,21 @@ 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]

# Use yamllint to check for valid YAML files and list syntax errors
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.32.0
rev: v1.33.0
hooks:
- id: yamllint
args: [--format, parsable, -c=.yamllint]

# 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 scripts.helpers import get_last_commit_message

from snakemake.remote.HTTP import RemoteProvider as HTTPRemoteProvider
Expand Down Expand Up @@ -50,6 +50,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
38 changes: 36 additions & 2 deletions 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 Expand Up @@ -224,6 +229,35 @@ sector:
efficiency_heat_biomass_to_elec: 0.9
efficiency_heat_gas_to_elec: 0.9

dynamic_transport:
enable: true # If "True", then the BEV and FCEV shares are obtained depening on the "Co2L"-wildcard (e.g. "Co2L0.70: 0.10"). If "False", then the shares are obtained depending on the "demand" wildcard and "planning_horizons" wildcard as listed below (e.g. "DF_2050: 0.08")
land_transport_electric_share:
Co2L2.0: 0.00
Co2L1.0: 0.01
Co2L0.90: 0.03
Co2L0.80: 0.06
Co2L0.70: 0.10
Co2L0.60: 0.17
Co2L0.50: 0.27
Co2L0.40: 0.40
Co2L0.30: 0.55
Co2L0.20: 0.69
Co2L0.10: 0.80
Co2L0.00: 0.88
land_transport_fuel_cell_share:
Co2L2.0: 0.01
Co2L1.0: 0.01
Co2L0.90: 0.01
Co2L0.80: 0.01
Co2L0.70: 0.01
Co2L0.60: 0.01
Co2L0.50: 0.01
Co2L0.40: 0.01
Co2L0.30: 0.01
Co2L0.20: 0.01
Co2L0.10: 0.01
Co2L0.00: 0.01

land_transport_fuel_cell_share: # 1 means all FCEVs HERE
BU_2030: 0.00
AP_2030: 0.004
Expand Down Expand Up @@ -273,7 +307,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 248b9f8

Please sign in to comment.