Trade-offs between geographic scale, cost, and infrastructure requirements for fully renewable electricity in Europe
This repository contains the entire scientific project, including code and report. The philosophy behind this repository is that no intermediary results are included, but all results are computed from raw data and code.
This study uses the model of the European electricity system euro-calliope v1.0.
-
Clone the repo. Because
euro-calliope
is added as a git submodule, you may want to clone usinggit clone --recurse-submodules <link-to-this-repo>
. -
Create an environment to run the analysis. You need conda to run the analysis. Using conda, you can create a conda environment from within you can run it:
conda env create -f environment.yaml
-
Make sure you have a Gurobi license, or install and configure another solver.
-
You need an account at the Copernicus Climate Data Service and you need to create a
$HOME/.cdsapirc
file with your credentials, see their How To (you do not need to manually install the client). -
Provide the input data for Euro-Calliope, as defined in "Getting Ready" in
./euro-calliope/README.md
. -
To run the uncertainty analysis, you need MATLAB and UQLab installed:
-
Install MATLAB R2019a.
-
Add UQLab's
core
folder to the MATLAB search path on startup, to be able to callUQLab
from outside its own folder.
-
snakemake --use-conda
This will run all analysis steps to reproduce results and eventually build the report.
You can also run certain parts only by using other snakemake
rules; to get a list of all rules run snakemake --list
.
To generate a PDF of the dependency graph of all steps, and if you have dot
installed, run:
snakemake --rulegraph | dot -Tpdf > dag.pdf
To run on Euler, use the following command:
snakemake --use-conda --profile config/euler [--config ifttt_apikey=<your-apikey>]
By providing an IFTTT api key, you can be informed when Snakemake finishes execution, see below.
If you prefer working locally, you can sync this repository to Euler and receive build changes by running snakemake send
and snakemake receive
.
If you want to run on another cluster, read snakemake's documentation on cluster execution and take config/euler
as a starting point.
If you generally run on a cluster but you do not have access to MATLAB or UQLab on it, you can run all parts involving UQLab on another machine where it is installed. Manually perform the following steps:
-
Run
snakemake --use-conda all_experimental_designs
on the machine with UQLab and copy all experimental designs onto the cluster. -
Run
snakemake --use-conda --profile config/euler all_experiments
on the cluster and copy all files to the machine with UQLab. -
Run
snakemake --use-conda uncertainty_analysis
on the machine with UQLab and copy the files to the cluster.
snakemake test --use-conda
As the execution of this workflow may take long, you can get notified whenever the execution terminates either successfully or unsuccessfully. Notification are handled by the webservice IFTTT for which you need a free account. To activate notifications, add your IFTTT webhooks apikey to the configuration using the configuration key ifttt_apikey
. For example, you may want to choose running the workflow the following way to receive notifications:
snakemake --use-conda --config ifttt_apikey=<your-apikey>
This workflow will then trigger the IFTTT events snakemake_succeeded
and snakemake_failed
. You can build IFTTT applets that react to these events, and for example let the notification be pushed to your phone or let your internet-connected light bulb flash red or green. Here's an example that you can use as a starting point.
The default units for Euro-Calliope are MW
, MWh
, EUR
, and km2
, but you can scale all of these using the configuration values in config/default.yaml
. Apart from convenience, this may be important to handle numerical issues with your solver.
report
: contains all files necessary to build the report; plots and result files are not in here but generated automaticallysrc
: contains the Python source codeenvs
: contains execution environmentstests
: contains the test codeconfig
: configurations used in the studydata
: place for raw databuild
: will contain all results (does not exist initially)
The code in this repo is MIT licensed, see ./LICENSE.md
. This excludes the KlinicSlab font family (all files in ./report/fonts/
) which is copyright Lost Type.