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 Oct 12, 2023
2 parents e392470 + 5537672 commit 9ee15d3
Show file tree
Hide file tree
Showing 16 changed files with 1,053 additions and 365 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ data/industry_sector_ratios_NZ_2030.csv
#/data/Industrial_Database.csv
/data/retro/tabula-calculator-calcsetbuilding.csv
/data/nuts*
/data/demand/unsd/data
/data/ports.csv
/data/energy_totals_DF_2030
/data/energy_totals_XX_2038

/data/airports.csv
/data/energy_totals_base.csv
/scripts/old
doc/_build
/cutouts
Expand All @@ -46,10 +53,14 @@ doc/_build
/scripts/data
/sample_pypsa_eur

/notebooks
/slurm
# File extensions
*.org
*.nc
*.xls
*.xlsx
*~
*.pyc

!data/demand/unsd/paths/Energy_Statistics_Database.xlsx
36 changes: 36 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ rule prepare_ports:
"scripts/prepare_ports.py"


rule prepare_airports:
output:
ports="data/airports.csv",
# TODO move from data to resources
script:
"scripts/prepare_airports.py"


rule prepare_sector_network:
input:
network=RDIR
Expand Down Expand Up @@ -242,6 +250,24 @@ rule prepare_heat_data:
"scripts/prepare_heat_data.py"


rule build_base_energy_totals:
input:
unsd_paths="data/demand/unsd/paths/Energy_Statistics_Database.xlsx",
output:
energy_totals_base="data/energy_totals_base.csv",
script:
"scripts/build_base_energy_totals.py"


rule prepare_energy_totals:
input:
unsd_paths="data/energy_totals_base.csv",
output:
energy_totals="data/energy_totals_{demand}_{planning_horizons}.csv",
script:
"scripts/prepare_energy_totals.py"


rule build_solar_thermal_profiles:
input:
pop_layout_total="resources/population_shares/pop_layout_total.nc",
Expand Down Expand Up @@ -371,6 +397,15 @@ rule copy_config:
"scripts/copy_config.py"


rule copy_commit:
output:
SDIR + "/commit_info.txt",
shell:
"""
git log -n 1 --pretty=format:"Commit: %H%nAuthor: %an <%ae>%nDate: %ad%nMessage: %s" > {output}
"""


rule solve_network:
input:
overrides="data/override_component_attrs",
Expand All @@ -380,6 +415,7 @@ rule solve_network:
+ "/prenetworks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_{sopts}_{planning_horizons}_{discountrate}_{demand}_{h2export}export.nc",
costs=CDIR + "costs_{planning_horizons}.csv",
configs=SDIR + "/configs/config.yaml", # included to trigger copy_config rule
commit=SDIR + "/commit_info.txt",
output:
RDIR
+ "/postnetworks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_{sopts}_{planning_horizons}_{discountrate}_{demand}_{h2export}export.nc",
Expand Down
9 changes: 9 additions & 0 deletions config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ countries: ['MA']
demand_data:
update_data: true # if true, the workflow downloads the energy balances data saved in data/demand/unsd/data again. Turn on for the first run.
base_year: 2019

other_industries: False # Whether or not to include industries that are not specified. some countries have has exageratted numbers, check carefully.

H2_network: false
H2_network_limit: 2000 #GWkm
H2_repurposed_network: false
Expand Down Expand Up @@ -220,6 +222,9 @@ sector:

biomass_transport: true # biomass transport between nodes

efficiency_heat_oil_to_elec: 0.9
efficiency_heat_biomass_to_elec: 0.9
efficiency_heat_gas_to_elec: 0.9

land_transport_fuel_cell_share: # 1 means all FCEVs HERE
BU_2030: 0.00
Expand Down Expand Up @@ -267,6 +272,10 @@ sector:
SMR: true
cc_fraction: 0.9
cc: true
space_heat_share: 0.6 # the share of space heating from all heating. Remainder goes to water heating.
airport_sizing_factor: 3



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

This file was deleted.

5 changes: 5 additions & 0 deletions data/demand/district_heating.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
country,current,potential
MA, 0, 0
NG, 0, 0
BJ, 0, 0
EG, 0, 0
5 changes: 5 additions & 0 deletions data/demand/efficiency_gains_cagr.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
,total residential space,total residential water,electricity residential,total services space,total services water,total rail,electricity rail,total domestic aviation,total international aviation,total domestic navigation,total international navigation,services electricity,agriculture electricity,agriculture oil,residential oil,residential biomass,residential gas,agriculture biomass,services oil,services biomass,services gas,total road ev,total road fcev,total road ice,total navigation oil,total navigation hydrogen,residential heat biomass,residential heat oil,residential heat gas
MA,-0.004951421072036277,-0.010390428883694458,-0.0026960063028712566,-0.006705489381695462,-0.01786431270106026,-0.004951421072036277,-0.0021462195974406573,0.0,0.0,-0.01786431270106026,0.2742749857031337,-0.0026960063028712566,-0.0026960063028712566,-0.006705489381695462,0.0,-0.004951421072036277,-0.010390428883694458,-0.012329796028156648,0.0,-0.0055299435560203225,0.0,-0.06140104567447868,-0.026527359809364603,0.0,-0.0010627352815874014,-0.00851714967450834,-0.0026960063028712566,-0.0026960063028712566,0.0
NG,-0.004951421072036277,-0.010390428883694458,-0.0026960063028712566,-0.006705489381695462,-0.01786431270106026,-0.004951421072036277,-0.0021462195974406573,0.0,0.0,-0.01786431270106026,0.2742749857031337,-0.0026960063028712566,-0.0026960063028712566,-0.006705489381695462,0.0,-0.004951421072036277,-0.010390428883694458,-0.012329796028156648,0.0,-0.0055299435560203225,0.0,-0.06140104567447868,-0.026527359809364603,0.0,-0.0010627352815874014,-0.00851714967450834,-0.0026960063028712566,-0.0026960063028712566,0.0
BJ,-0.004951421072036277,-0.010390428883694458,-0.0026960063028712566,-0.006705489381695462,-0.01786431270106026,-0.004951421072036277,-0.0021462195974406573,0.0,0.0,-0.01786431270106026,0.2742749857031337,-0.0026960063028712566,-0.0026960063028712566,-0.006705489381695462,0.0,-0.004951421072036277,-0.010390428883694458,-0.012329796028156648,0.0,-0.0055299435560203225,0.0,-0.06140104567447868,-0.026527359809364603,0.0,-0.0010627352815874014,-0.00851714967450834,-0.0026960063028712566,-0.0026960063028712566,0.0
EG,-0.004951421072036277,-0.010390428883694458,-0.0026960063028712566,-0.006705489381695462,-0.01786431270106026,-0.004951421072036277,-0.0021462195974406573,0.0,0.0,-0.01786431270106026,0.2742749857031337,-0.0026960063028712566,-0.0026960063028712566,-0.006705489381695462,0.0,-0.004951421072036277,-0.010390428883694458,-0.012329796028156648,0.0,-0.0055299435560203225,0.0,-0.06140104567447868,-0.026527359809364603,0.0,-0.0010627352815874014,-0.00851714967450834,-0.0026960063028712566,-0.0026960063028712566,0.0
5 changes: 5 additions & 0 deletions data/demand/fuel_shares.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
country,oil residential heat share,biomass residential heat share,biomass to elec heat share,oil to elec heat share,biomass to elec share,oil to elec share,space to water heat share,gas to elec share,gas to elec heat share,gas residential heat share
MA, 0.6667, 0.75,0.0, 0.5, 0.0, 0.5,0.6,0,0,0.75
NG, 0.6667, 0.75,0.0, 0.5, 0.0, 0.5,0.6,0,0,0.75
BJ, 0.6667, 0.75,0.0, 0.5, 0.0, 0.5,0.6,0,0,0.75
EG, 0.6667, 0.75,0.0, 0.5, 0.0, 0.5,0.6,0,0,0.75
5 changes: 5 additions & 0 deletions data/demand/growth_factors_cagr.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
,total residential space,total residential water,electricity residential,total services space,total services water,total road,total rail,electricity rail,total domestic aviation,total international aviation,total domestic navigation,total international navigation,services electricity,agriculture electricity,agriculture oil,residential oil,residential biomass,residential gas,agriculture biomass,services oil,services biomass,services gas,residential heat oil,residential heat biomass,residential heat gas
MA,0.021569600815111167,0.025045532052292208,0.055685686523292866,0.01786680031720378,0.021569600815111167,0.01390442519840307,0.04940761418323669,0.03982178088300037,0.03715504444619189,0.021569600815111167,0.006453239989770987,0.025045532052292208,0.03715504444619189,0.021569600815111167,-0.018597262031625594,0.0,0.0,0.01095505452809764,0.0147194767041825,-0.03582400205750491,0.0,-0.006114588100848528,0.0,0.0,0.0
NG,0.021569600815111167,0.025045532052292208,0.055685686523292866,0.01786680031720378,0.021569600815111167,0.01390442519840307,0.04940761418323669,0.03982178088300037,0.03715504444619189,0.021569600815111167,0.006453239989770987,0.025045532052292208,0.03715504444619189,0.021569600815111167,-0.018597262031625594,0.0,0.0,0.01095505452809764,0.0147194767041825,-0.03582400205750491,0.0,-0.006114588100848528,0.0,0.0,0.0
BJ,0.021569600815111167,0.025045532052292208,0.055685686523292866,0.01786680031720378,0.021569600815111167,0.01390442519840307,0.04940761418323669,0.03982178088300037,0.03715504444619189,0.021569600815111167,0.006453239989770987,0.025045532052292208,0.03715504444619189,0.021569600815111167,-0.018597262031625594,0.0,0.0,0.01095505452809764,0.0147194767041825,-0.03582400205750491,0.0,-0.006114588100848528,0.0,0.0,0.0
EG,0.021569600815111167,0.025045532052292208,0.055685686523292866,0.01786680031720378,0.021569600815111167,0.01390442519840307,0.04940761418323669,0.03982178088300037,0.03715504444619189,0.021569600815111167,0.006453239989770987,0.025045532052292208,0.03715504444619189,0.021569600815111167,-0.018597262031625594,0.0,0.0,0.01095505452809764,0.0147194767041825,-0.03582400205750491,0.0,-0.006114588100848528,0.0,0.0,0.0
Binary file not shown.
9 changes: 2 additions & 7 deletions data/energy_totals_DF_2030.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
country,total residential space,electricity residential space,total residential water,electricity residential water,total residential cooking,electricity residential cooking,total residential,electricity residential,derived heat residential,thermal uses residential,total services space,electricity services space,total services water,electricity services water,total services cooking,electricity services cooking,total services,electricity services,derived heat services,thermal uses services,total agriculture electricity,total agriculture heat,total agriculture machinery,total agriculture,total road,electricity road,total two-wheel,total passenger cars,electricity passenger cars,total other road passenger,electricity other road passenger,total light duty road freight,electricity light duty road freight,total heavy duty road freight,total rail,electricity rail,total rail passenger,electricity rail passenger,total rail freight,electricity rail freight,total aviation passenger,total aviation freight,total domestic aviation passenger,total international aviation passenger,total domestic aviation freight,total international aviation freight,total domestic aviation,total international aviation,total domestic navigation,district heat share,total international navigation,services electricity,agriculture electricity,agriculture oil,residential oil,residential biomass
MA,4.2,0.28,7.3,0.23,4.9,3.3,23.31,8.03,,,,,,,,,15.89,9.13,,,4.91,0,,12.03,64.23,,,,,,,,,,,,,,,,,,,,,,0.39,8.93,10.32,,1.32,3.321242,3.66435234,5.344235432,3.6,2.7
NG,4.2,0.28,7.3,0.23,4.9,3.3,23.31,8.03,,,,,,,,,15.89,9.13,,,4.91,0,,12.03,64.23,,,,,,,,,,,,,,,,,,,,,,0.39,8.93,10.32,,1.32,3.321242,3.66435234,5.344235432,3.6,2.7
BJ,4.2,0.28,7.3,0.23,4.9,3.3,23.31,8.03,,,,,,,,,15.89,9.13,,,4.91,0,,12.03,64.23,,,,,,,,,,,,,,,,,,,,,,0.39,8.93,10.32,,1.32,3.321242,3.66435234,5.344235432,3.6,2.7
NA,4.2,0.28,7.3,0.23,4.9,3.3,23.31,8.03,,,,,,,,,15.89,9.13,,,4.91,0,,12.03,64.23,,,,,,,,,,,,,,,,,,,,,,0.39,8.93,10.32,,1.32,3.321242,3.66435234,5.344235432,3.6,2.7
BR,4.2,0.28,7.3,0.23,4.9,3.3,23.31,8.03,,,,,,,,,15.89,9.13,,,4.91,0,,12.03,64.23,,,,,,,,,,,,,,,,,,,,,,0.39,8.93,10.32,,1.32,3.321242,3.66435234,5.344235432,3.6,2.7
AE,4.2,0.28,7.3,0.23,4.9,3.3,23.31,8.03,,,,,,,,,15.89,9.13,,,4.91,0,,12.03,64.23,,,,,,,,,,,,,,,,,,,,,,0.39,8.93,10.32,,1.32,3.321242,3.66435234,5.344235432,3.6,2.7
,agriculture biomass,agriculture electricity,agriculture oil,electricity rail,electricity residential,residential biomass,residential gas,residential oil,services biomass,services electricity,services gas,services oil,total domestic aviation,total domestic navigation,total international aviation,total international navigation,total rail,total residential space,total residential water,total road,total services space,total services water,district heat share,electricity residential water,electricity residential space,electricity services space,electricity services water
MA,0.0,3.7943233899999993,12.220265024000001,0.4112628,11.8740713,7.0544838,0.0,25.168813287999996,4.96120807,5.9330894999999995,0.0,0.765688,0.3847932,0.0,12.69355680000002,1.9635325499999998,0.1264536,0.0,0.0,85.52591748000002,0.0,0.0,0,0,0,0,0
Loading

0 comments on commit 9ee15d3

Please sign in to comment.