Skip to content

GB-dispatch model: a dispatch and re-dispatch model for the future Great Britain power system (based on PyPSA-Eur and NESO Future Energy Scenarios)

Notifications You must be signed in to change notification settings

open-energy-transition/gb-dispatch-model

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6,778 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub release (latest by date including pre-releases) Test workflows Documentation Size Zenodo PyPSA-Eur Zenodo PyPSA-Eur-Sec Snakemake Discord REUSE status

gb-dispatch-model

Open Energy Transition Logo

This repository is a soft-fork of PyPSA-Eur and contains the entire project gb-dispatch-model supported by Open Energy Transition (OET)*, 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. The structure is also inspired by cookiecutter-project.

This repository is maintained using OET's soft-fork strategy. OET's primary aim is to contribute as much as possible to the open source (OS) upstream repositories. For long-term changes that cannot be directly merged upstream, the strategy organizes and maintains OET forks, ensuring they remain up-to-date and compatible with upstream, while also supporting future contributions back to the OS repositories.

Repository structure

  • benchmarks: will store snakemake benchmarks (does not exist initially)
  • config: configurations used in the study
  • cutouts: will store raw weather data cutouts from atlite (does not exist initially)
  • data: includes input data that is not produced by any snakemake rule
  • doc: includes all files necessary to build the readthedocs documentation of PyPSA-Eur
  • envs: includes backup conda environments if pixi installation does not work.
  • logs: will store log files (does not exist initially)
  • notebooks: includes all the notebooks used for ad-hoc analysis
  • report: contains all files necessary to build the report; plots and result files are generated automatically
  • rules: includes all the snakemakerules loaded in the Snakefile
  • resources: will store intermediate results of the workflow which can be picked up again by subsequent rules (does not exist initially)
  • results: will store the solved PyPSA network data, summary files and plots (does not exist initially)
  • scripts: includes all the Python scripts executed by the snakemake rules to build the model

Installation and Usage

1. Installation

Clone the repository:

git clone https://github.com/open-energy-transition/{{repository}}

You need pixi to run the analysis. Once installed, activate your pixi environment in a terminal session:

pixi shell

Note

pixi will create a distinct environment in every project directory, even if you have identical copies of a project cloned locally. As there is a common system-level package cache, pixi efficiently conserves disk space in such cases.

Tip

If pixi isn't working, you can install from one of the fallback conda environment files found in envs. For more details see the PyPSA-Eur installation guide.

Extra soft-fork dependencies

If you add dependencies to your project, we recommend you add them to a new pixi environment. For instance, if you need access to plotly, want to pin the version of gurobi you are using, and want to add a PyPI dependency:

pixi add -f {{ project_short_name }} "gurobi<13" "plotly"
pixi add -f {{ project_short_name }} --pypi pypsa-explorer

This will create these entries in your pixi.toml

[feature.{{ project_short_name }}.pypi-dependencies]
pypsa-explorer = "*"

[feature.{{ project_short_name }}.dependencies]
gurobi = "<13"
plotly = "*"

Then, you can create an environment from this feature in pixi.toml:

[environments]
...
{{ project_short_name }} = [{{ project_short_name }}]

These dependencies will be combined with the core PyPSA-Eur dependencies and can be accessed by calling:

pixi shell -e {{ project_short_name }}

Updating CI tests

To run CI tests using your environment you should add the test feature to it and create test tasks for your environment, e.g.:

[feature.{{ project_short_name }}.tasks]
{{ project_short_name }}-test = """
	snakemake --configfile config/config.{{ project_short_name }}.default.yaml -n &&
    """
[environments]
...
{{ project_short_name }} = ["test", {{ project_short_name }}]

And then update .github/workflows/test.yaml to run that test:

- name: Run project-specific snakemake test workflows
  run: |
    pixi run {{ project_short_name }}-test

If you also add your own unit tests, update the unit test runner to use your environment as well:

- name: Run unit tests
  run: |
    pixi run -e {{ project_short_name }} unit-tests

2. Run the analysis

pixi run model

This will run all analysis steps to reproduce results and build the report.

To generate a PDF of the dependency graph of all steps resources/dag.pdf run:

pixi run snakemake -c1 dag

* Open Energy Transition (g)GmbH, Königsallee 52, 95448 Bayreuth, Germany



PyPSA-Eur: A Sector-Coupled Open Optimisation Model of the European Energy System

PyPSA-Eur is an open model dataset of the European energy system at the transmission network level that covers the full ENTSO-E area and all energy sectors, including transport, heating, biomass, industry, and agriculture. Besides the power grid, pipeline networks for gas, hydrogen, carbon dioxide, and liquid fuels are included. The model is suitable both for planning studies and operational studies. The model is built from open data using a Snakemake workflow and fully open source. It is designed to be imported into the open-source energy system modelling framework PyPSA.

Note

PyPSA-Eur has many contributors, with the maintenance currently led by the Department of Digital Transformation in Energy Systems at the Technical University of Berlin. Previous versions were developed at the Karlsruhe Institute of Technology funded by the Helmholtz Association.

Among many other things, the dataset consists of:

  • A power grid model based on OpenStreetMap for voltage levels above 220kV (optional above 60kV).
  • The open power plant database powerplantmatching.
  • Electrical demand time series from the ENTSO-E Transparency Platform.
  • Renewable time series based on ERA5 and SARAH-3, assembled using atlite.
  • Geographical potentials for wind and solar generators based land eligibility analysis in atlite.
  • Energy balances compiled from Eurostat and JRC-IDEES datasets.

The high-voltage grid and the power plant fleet are shown in this map of the unclustered model (as of 1 January 2026):

PyPSA-Eur Unclustered

For computational reasons the model is usually clustered down to 50-250 nodes. The image below shows the electricity network and power plants clustered to NUTS2 regions:

network diagram

This diagram gives an overview of the sectors and the links between them within each model region:

sector diagram

Warnings

PyPSA-Eur is under active development and has several limitations which you should understand before using the model. The github repository issues collect known topics we are working on (please feel free to help or make suggestions). The documentation remains somewhat patchy. You can find showcases of the model's capabilities in the Joule paper The potential role of a hydrogen network in Europe, another paper in Joule with a description of the industry sector, or in a 2021 presentation at EMP-E. We do not recommend to use the full resolution network model for simulations. At high granularity the assignment of loads and generators to the nearest network node may not be a correct assumption, depending on the topology of the underlying distribution grid, and local grid bottlenecks may cause unrealistic load-shedding or generator curtailment. We recommend to cluster the network to a couple of hundred nodes to remove these local inconsistencies. See the discussion in Section 3.4 "Model validation" of the paper.

Contributing and Support

We strongly welcome anyone interested in contributing to this project. If you have any ideas, suggestions or encounter problems, feel invited to file issues or make pull requests on GitHub.

  • To discuss with other PyPSA users, organise projects, share news, and get in touch with the community you can use the Discord server.
  • For bugs and feature requests, please use the PyPSA-Eur Github Issues page.

Licence

The code in PyPSA-Eur is released as free software under the MIT License, see doc/licenses.rst. However, different licenses and terms of use may apply to the various input data, see doc/data_sources.rst.

About

GB-dispatch model: a dispatch and re-dispatch model for the future Great Britain power system (based on PyPSA-Eur and NESO Future Energy Scenarios)

Resources

Stars

Watchers

Forks

Languages

  • Python 99.8%
  • Other 0.2%