Retrieving Data¶
Not all data dependencies are shipped with the git repository, since git is not suited for handling large changing files.
Instead we use separate steps in the workflow (rules executed by snakemake) to download external data using the retrieve_<dataset> rules.
Data is generally retrieved in a version-controlled manner, enabling control over input data versions, reproducibility and consistency of modelling runs.
The rules download data into subfolders in the data/ directory, following the structure
data/{dataset}/{source}/{version}, e.g. data/jrc_idees/primary/March-2025-V1/.
Which specific data version is retrieved can be controlled in the data configuration.
Every dataset is listed with its owner, link and license in the
data inventory. Its available versions and
sources (archive, primary or build) are registered in data/versions.csv.
Most retrieve_<dataset> rules simply download the registered URL for the
selected source. The rules below need more than that.
Rules requiring credentials¶
Credentials are read from environment variables. You can put them into a .env
file in the repository root, which is loaded automatically and ignored by git.
| Rule | Requirement |
|---|---|
| build_cutout | A Copernicus Climate Data Store account with the cdsapi key set up as described on their website. Only needed when data: cutout: source: build. |
retrieve_electricity_demand_entsoe |
An ENTSO-E Transparency Platform API token in ENTSOE_API_TOKEN. Only needed when data: entsoe_electricity_demand: source: build. |
retrieve_corine |
A Copernicus Land Monitoring Service API key in CORINE_API_TOKEN. Only needed when data: corine: source: primary. |
retrieve_seawater_temperature |
Copernicus Marine Service credentials configured for the copernicusmarine package. Only needed when heat pumps use the sea_water heat source with a non-test cutout. |
Example .env file
A .env file with all credentials looks like this. Only add the lines for
the rules you run. The file is listed in .gitignore, so git does not
commit it.
# build_cutout: Copernicus Climate Data Store (alternative to ~/.cdsapirc)
CDSAPI_URL=https://cds.climate.copernicus.eu/api
CDSAPI_KEY=<your-personal-access-token>
# retrieve_electricity_demand_entsoe: ENTSO-E Transparency Platform
ENTSOE_API_TOKEN=<your-entsoe-token>
# retrieve_corine: Copernicus Land Monitoring Service
CORINE_API_TOKEN=<your-clms-api-key>
# retrieve_seawater_temperature: Copernicus Marine Service
COPERNICUSMARINE_SERVICE_USERNAME=<your-username>
COPERNICUSMARINE_SERVICE_PASSWORD=<your-password>
Rules with special handling¶
retrieve_cutoutdownloads pre-built weather cutouts; see cutouts.retrieve_osm_data_rawqueries the Overpass API per country whendata: osm: source: build. The endpoint, retries and user agent are set under overpass_api.retrieve_wdpaandretrieve_wdpa_marineresolve the monthly changing download URL of the World Database on Protected Areas. The data may not be redistributed, so thearchivesource points to a web archive copy.retrieve_bidding_zones_entsoepyandretrieve_bidding_zones_electricitymapsdownload bidding zone shapes via the entsoe-py package and from Electricity Maps. They are combined by build_bidding_zones.retrieve_cost_datadownloads techno-economic assumptions from the technology-data repository asdata/costs/{source}/{version}/costs_{horizon}.csv. The cost year can be fixed withcosts: year:(see costs).
Electricity demand data¶
Historical hourly electricity demand is retrieved from three sources and combined by build_electricity_demand:
| Rule | Source | Output |
|---|---|---|
retrieve_electricity_demand_opsd |
OPSD platform, per country | data/opsd_electricity_demand/{source}/{version}/electricity_demand_opsd_raw.csv |
retrieve_electricity_demand_entsoe |
ENTSO-E Transparency Platform, per country | data/entsoe_electricity_demand/{source}/{version}/electricity_demand_entsoe_raw.csv |
retrieve_electricity_demand_neso |
NESO Data Portal, United Kingdom | data/neso_electricity_demand/{source}/{version}/electricity_demand_neso_raw.csv |
The spatial distribution of demand within countries uses:
retrieve_electricity_demand_energy_atlas: a 1 km by 1 km raster of estimated annual electricity demand from the JRC Energy Atlas.retrieve_desnz_electricity_consumption: subnational electricity consumption for Great Britain from the Department for Energy Security and Net Zero.retrieve_ons_lad: shapefiles of local authorities in the United Kingdom from the Office for National Statistics.