Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demand workflow #219

Merged
merged 49 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
905dbbf
adding a working script
hazemakhalek Aug 16, 2023
0ec3c8e
add the rule in the snakefile
hazemakhalek Aug 16, 2023
9dbf015
rename script to add new
hazemakhalek Aug 16, 2023
1397b92
in-script documentation and option to trigger download
hazemakhalek Aug 16, 2023
e6f9d71
update config files
hazemakhalek Aug 16, 2023
5c3dfe5
adapt snakefile rule
hazemakhalek Aug 16, 2023
56c97af
remove unnecessay commands and files
hazemakhalek Aug 16, 2023
ef8ccfd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 17, 2023
f0bb45a
Update Snakefile
hazemakhalek Aug 17, 2023
2b88844
add file with unsd data sources
hazemakhalek Aug 17, 2023
576a76e
add script to project energy_totals of the future scenario
hazemakhalek Aug 17, 2023
cba9e75
add necessary csv files for the ser to adapt the activity growth and …
hazemakhalek Aug 17, 2023
95b288e
change locations of the unsd data
hazemakhalek Aug 17, 2023
509cfbf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 17, 2023
86898d0
adding the excel file with all the paths
hazemakhalek Aug 17, 2023
80ff049
add rule prepare_energy_totals to snakefile
hazemakhalek Aug 17, 2023
6816947
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 17, 2023
04c0c6f
Update config.test1.yaml
hazemakhalek Aug 17, 2023
889de1a
adapt residential sector and fix bug in road transport
hazemakhalek Aug 23, 2023
1aa33e6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 23, 2023
78154fd
adapt csv files needed for demand workflow
hazemakhalek Aug 23, 2023
6bad5be
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 23, 2023
9570636
add needed config params
hazemakhalek Aug 23, 2023
aefb6f8
adapt for elec residential heat demand
hazemakhalek Sep 27, 2022
211ca4f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 23, 2023
1b94ea4
Merge branch 'main' into demand_workflow
davide-f Aug 24, 2023
fab43e7
Merge branch 'main' into demand_workflow
davide-f Aug 24, 2023
b5b65c4
Update build_base_energy_totals.py
hazemakhalek Aug 24, 2023
41d9ce7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 24, 2023
cce5c48
add missing parameter in config.test
hazemakhalek Aug 24, 2023
54c68ee
adapting workflow for other countries
hazemakhalek Aug 24, 2023
cc59716
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 24, 2023
b16ba49
make residential with all carreirs a default sector
hazemakhalek Aug 24, 2023
9acfc8d
add all sectors to the default workflow
hazemakhalek Aug 24, 2023
cc14933
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 24, 2023
4d15bdd
fix bug of heat shape
hazemakhalek Aug 25, 2023
b5ed6dd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 25, 2023
ed04065
diagnosing CI bug
hazemakhalek Aug 25, 2023
32ce03d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 25, 2023
e1e8a69
CI bug solving trial
hazemakhalek Aug 25, 2023
3258cd7
make pöd custom sector work for many countries at once
hazemakhalek Aug 25, 2023
174ae27
resolving PR comments
hazemakhalek Aug 29, 2023
1614c58
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 29, 2023
7732e1b
resemove unnecessary files
hazemakhalek Aug 29, 2023
bf8833a
add example energy_totals file needed for workflow
hazemakhalek Aug 29, 2023
243f9d1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 29, 2023
d9cfc2d
change growth factors and efficiency gains to cagr
hazemakhalek Aug 29, 2023
2b5a0a9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 29, 2023
243b8b5
correct the default cagr values
hazemakhalek Aug 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

# File extensions
*.org
*.nc
*.xls
*.xlsx
*~
*.pyc

!data/demand/unsd/paths/Energy_Statistics_Database.xlsx
18 changes: 18 additions & 0 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,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
9 changes: 8 additions & 1 deletion config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ clustering_options:

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

H2_network: false
H2_network_limit: 2000 #GWkm
H2_repurposed_network: false
Expand Down Expand Up @@ -216,6 +220,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 @@ -263,7 +270,7 @@ 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.
conventional_generation: # generator : carrier
OCGT: gas
#Gen_Test: oil # Just for testing purposes
Expand Down
4 changes: 4 additions & 0 deletions data/demand/district_heating.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
country,current,potential
MA, 0, 0
NG, 0, 0
BJ, 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
4 changes: 4 additions & 0 deletions data/demand/fuel_shares.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
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
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
hazemakhalek marked this conversation as resolved.
Show resolved Hide resolved
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
Loading