Skip to content

Commit dc27634

Browse files
committed
Merge branch 'develop'
2 parents 0be5ad1 + 638e762 commit dc27634

File tree

94 files changed

+5944
-75
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+5944
-75
lines changed

.flake8

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
max-line-length = 119
3+
ignore = E261, W503
4+
exclude = Snakefile, *.smk
5+
builtins = snakemake # for using the snakemake injection in scripts

.gitignore

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
1+
build
2+
data
3+
4+
notebooks
5+
6+
gurobi.log
7+
18
# Python
29
*.pyc
310
build/
411
dist/
512
__pycache__
613
*.egg-info
714
.cache/
8-
src/.pytest_cache
15+
.pytest_cache
16+
src/data
917

1018
# Snakemake
11-
src/.snakemake/
19+
.snakemake/
1220
dag.pdf
21+
22+
# Sync infrastructure
23+
.syncignore
24+
.syncignore-build
25+
rules/sync.smk

CITATION.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
If you use euro-calliope in an academic publication, please cite the following article:
2+
3+
Tröndle, T., Lilliestam, J., Marelli, S., Pfenninger, S., 2020. Trade-offs between geographic scale, cost, and infrastructure requirements for fully renewable electricity in Europe. Joule.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2018 Tim Tröndle
1+
Copyright (c) 2018-2020 Tim Tröndle (IASS Potsdam), Bryn Pickering (ETH Zürich)
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the

README.md

Lines changed: 94 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,109 @@
11
# Euro Calliope
22

3-
A model of the European power system built using Calliope.
3+
A model of the European electricity system built using Calliope.
44

5-
This repository contains the model and the routines that automatically generate the model from source data.
5+
This repository contains the workflow routines that automatically build the model from source data. Alternatively to building models yourself, you can use pre-built models that run out-of-the-box, see link below.
66

7-
## Getting ready
7+
[![pre-built models DOI](https://img.shields.io/badge/prebuilts-10.5281%2Fzenodo.3949553-blue)](https://doi.org/10.5281/zenodo.3949553)
88

9-
You need [conda](https://conda.io/docs/index.html) to use the model. Using conda, you can create a conda environment from within you can run the model:
9+
## At a glance
1010

11-
conda env create -f requirements.yml
11+
euro-calliope models the European electricity system with each location representing an administrative unit. It can be built on three spatial resolutions: on the continental level as a single location, on the national level with 34 locations, and on the regional level with 497 locations. On each node, renewable generation capacities (wind, solar, bioenergy) and balancing capacities (battery, hydrogen) can be built. In addition, hydro electricity and pumped hydro storage capacities can be built up to the extent to which they exist today. All capacities are used to satisfy electricity demand on all locations which is based on historic data. Locations are connected through transmission lines of unrestricted capacity. Using [Calliope](https://www.callio.pe), the model is formulated as a linear optimisation problem with total monetary cost of all capacities as the minimisation objective. All elements of euro-calliope can be manipulated either by changing the configuration in `config/default.yaml` or by manipulating the build workflow before building the model.
1212

13-
Don't forget to activate the environment.
13+
## Get ready to build the model
14+
15+
1. The workflow is developed on macOS, should run on Linux (untested), and cannot run natively on Windows.
16+
17+
2. You need [conda](https://conda.io/docs/index.html) to build and use the model. Using conda, you can create a conda environment from within you can build the model:
18+
19+
```
20+
conda env create -f environment.yaml
21+
conda activate euro-calliope
22+
```
23+
24+
3. You need a Gurobi license installed on your computer, or you need to choose a different solver.
25+
26+
4. 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](https://cds.climate.copernicus.eu/api-how-to) (you do not need to manually install the client).
27+
28+
5. Further, you need all data files that cannot be retrieved automatically:
29+
30+
* [Maritime Boundaries v10 -> World Exclusive Economic Zones v10](http://www.marineregions.org/downloads.php), to be placed in `./data/World_EEZ_v10_20180221`
31+
* [hydroBASINS -> Standard -> Europe and Middle East -> hybas_eu_lev07_v1c](https://www.hydrosheds.org/downloads) downloaded to `./data/hybas_eu_lev07_v1c/`
32+
33+
## Build the model
34+
35+
Because input data is large, the actual model including its data is not part of this repository. To use the model, you first need to build it from input data and scripts. Running the build step will build the model in the `./model` folder.
36+
37+
snakemake --use-conda
38+
39+
## Build the model on Euler cluster
40+
41+
To run on Euler, use the following command:
42+
43+
snakemake --use-conda --profile config/euler
44+
45+
If you want to run on another cluster, read [snakemake's documentation on cluster execution](https://snakemake.readthedocs.io/en/stable/executable.html#cluster-execution) and take `config/euler` as a starting point.
1446

1547
## Example use of the model
1648

17-
Coming soon.
49+
The build step creates all individual components of `euro-calliope`, like technologies and time series. These can be combined to eventually build a final model to run simulations with. For an example of such a model, see `./build/model/{resolution}/example-model.yaml`. It is a complete Calliope model and can be used like any other, for example like this:
1850

19-
## Run the tests
51+
```Bash
52+
$ calliope run ./build/model/national/example-model.yaml
53+
```
2054

21-
Coming soon.
55+
For more information on how to use and modify Calliope models, see [Calliope's documentation](https://calliope.readthedocs.io).
56+
57+
## Model components
58+
59+
After a successful full build (see "Build the model"), the following files will exist in `build/model`:
60+
61+
```
62+
├── {resolution} <- For each spatial resolution an individual folder.
63+
│ ├── capacityfactors-{technology}.csv <- Timeseries of capacityfactors of all renewables.
64+
│ ├── directional-rooftop.yaml <- Override discriminating rooftop PV by orientation.
65+
│ ├── electricity-demand.csv <- Timeseries of electricity demand on each node.
66+
│ ├── example-model.yaml <- Calliope model definition.
67+
│ ├── link-all-neighbours.yaml <- Connects neighbouring locations with transmission.
68+
│ ├── locations.csv <- Map from Calliope location id to name of location.
69+
│ └── locations.yaml <- Defines all locations and their max capacities.
70+
├── build-metadata.yaml <- Metadata of the build process.
71+
├── demand-techs.yaml <- Definition of demand technologies.
72+
├── environment.yaml <- A conda file defining an environment to run the model.
73+
├── interest-rate.yaml <- Interest rate of all capacities.
74+
├── link-techs.yaml <- Definition of link technologies.
75+
├── README.md <- Documentation.
76+
├── renewable-techs.yaml <- Definition of supply technologies.
77+
└── storage-techs.yaml <- Definition of storage technologies.
78+
```
79+
80+
Alternatively to a full build, each of these model components can be built individually, by running `snakemake --use-conda <path-to-component>`. The model components can be used to [configure a Calliope model](https://calliope.readthedocs.io/en/stable/user/building.html). For an example model configuration, see "Example use of the model" above.
81+
82+
## Units and scaling
83+
84+
The default units used within euro-calliope are `100 GW`, `100 GWh`, `billion EUR`, and `10,000 km2`. All data going into Calliope and all Calliope result data will be given using these units. While they may be unusual, these units lead to a numerical model that is well suited for the interior-point solution algorithm that is used by default. The units are tuned so as to work best for models with a time resolution of a few hours and a duration of one year. For other types of problems, or other solution algorithms, the units may need to be changed to avoid numerical issues within the solver.
85+
86+
You can easily change the units and scale all values using the `scaling-factor` configuration values in `config/default.yaml`. However, these values must be changed before building the model. You may want to run `snakemake clean` before changing these values. The base units on which the scaling factors are applied are `1 MW`, `1 MWh`, `EUR`, and `km2`. So for example, the default unit for energy (100 GWh) is derived by scaling the base unit (1 MWh) with a scaling factor of `0.00001`.
2287

2388
## Repo structure
2489

25-
* `model`: contains the entire model, including Calliope definition files and data
26-
* `src`: contains the Python source code to generate the model
27-
* `tests`: contains a test usage of the model
90+
* `build/model`: Contains the entire model after the build step, including Calliope definition files and data (does not exist initially).
91+
* `config`: Files with configuration parameters which influence the model build process.
92+
* `data`: Small input data used within the model build process.
93+
* `docs`: Documentation of the model and the build process.
94+
* `envs`: Files defining the conda environment which are used to build the model.
95+
* `rules`: Snakemake workflows defining the build process.
96+
* `src`: Contains the source code to build the model.
97+
* `tests`: Contains a test usage of the model.
98+
99+
## Run the tests
100+
101+
Tests of models with continental and national resolution run automatically when you run the entire workflow. To run the tests of models with regional resolution do the following:
102+
103+
snakemake --use-conda build/logs/regional/test-report.html
104+
105+
Exchanging `regional` with `national` or `continental` allows you to run tests on the respective resolution explicitly.
106+
107+
## License
108+
109+
euro-calliope has been developed and is maintained by Tim Tröndle, IASS Potsdam. The code in this repository is MIT licensed.

0 commit comments

Comments
 (0)