ToOp

Propose new topology strategies to the operators with the goal to lower redispatch costs and carbon emissions.
https://github.com/eliagroup/toop

Category: Energy Systems
Sub Category: Grid Analysis and Planning

Keywords

electric-grids energy topology-optimization

Last synced: about 13 hours ago
JSON representation

Repository metadata

Open Source Topology Optimization engine by Elia Group. Includes GPU‑based DC load flow solving, DC optimization, AC validation, and tools to explore congestion‑reducing topological actions.

README.md

CI
OpenSSF Scorecard

Quality Gate Status
Coverage
Duplicated Lines (%)

License: MPL 2.0
Python 3.11

Hello there 👋

Welcome to our ToOp (engine) repository at Elia Group.

A short intro - what is ToOp about?

ToOp is short for Topology Optimization and describes the approach to reduce grid congestion by topological actions. Topological actions are non-costly actions that can be applied to the grid to "steer" the electricity flow.
Our goal is to propose (potentially) new topology strategies to the operators with the goal to lower redispatch costs and carbon emissions.

This repository builds the engine behind the topology optimization product ToOp at Elia Group. ToOp provides tools to perform topology optimization on operational grid data through an importer, a DC optimization stage, and AC validation. It also includes the GPU-based DC load flow solver. At the current stage it considers transmission line switching, busbar splitting, busbar reassignments, and grouped PST tap optimization.

About this repository

This repo builds the engine behind the topology optimization project ToOp at Elia Group. The standard workflow first normalizes a raw grid into a processed grid folder containing the backend grid snapshot, masks, loadflow parameters, topology metadata, and an initial contingency definition. The DC preprocessing stage then adds static_information.hdf5, action_set.json, action_set_diffs.hdf5, and the final nminus1_definition.json used by the solver, optimizer, and postprocessing. Note that this does NOT provide a GUI or system integration code, you are expected to interact with the module through either python or kafka commands. You can check the paper for a high level academic introduction.
Please check out our full documentation.

Getting Started

If you want to get started with the engine, we highly recommend checking out our example notebooks.

Prerequisites

We use uv for dependency management.
You can follow their installation guide:

  1. Install on Linux/Mac via curl -LsSf https://astral.sh/uv/install.sh | sh
  2. or if you have pipx via pipx install uv.

If you want to contribute to this repository, follow the guide on our Contributing page.

Installation (without contributing)

You need to install our software via source by cloning this repository

  git clone https://github.com/eliagroup/ToOp.git
  cd ToOp

and installing dependencies

  uv sync --all-groups

If you plan to run this software on GPU-accelerated hardware, you may additionally install jax with CUDA support by running

  uv pip install jax[cuda12]

Note: We currently do not publish our package on PyPI. If you use uv for your own project and want to use ToOp, you can add it as a local dependency to your pyproject.toml, pointing to the cloned repository.

Usage

In order to understand the functionalities of this repo, please have a look at our examples in notebooks/.
There you can find several Jupyter notebooks that explain how to use the engine.
For example, you can import a grid file, build the preprocessing artifacts, and compute the DC loadflow using our GPU-based loadflow solver.
Or you can load an example grid and minimise the branch overload by running the topology optimizer.

You can also build the documentation and open it on your web browser by running

uv run mkdocs serve

Useful resources

The following resources may be helpful to grasp the key concepts:

Note: This project does not provide a GUI or system integration code.
You are expected to interact with the module through either python or kafka commands. This might come in the future if there is an interest from the community.

High-level architecture

ToOp Features and Roadmap

The topology optimizer takes as an input operational grid files (e.g. UCT, CGMES) which are imported by open-source libraries (PowSyBl, pandapower) and normalized into a processed grid folder. The importer stage writes the backend grid snapshot together with masks, loadflow parameters, and topology metadata; the DC preprocessing stage adds static_information.hdf5, action_set.json, and the final contingency definition. The pre-processed files are then optimized in a GPU-native set-up (optimizer + GPU-based load flow solver). The optimal results are stored as a pareto-front, so a set of all solutions that are "Pareto optimal". This means that no other solution exists that improves at least one objective without worsening another one. These results are then validated and filtered using an AC power flow. In the end the results are displayed in a frontend where an end user can review and evaluate the proposed actions. The proposed topological actions can then be exported to other systems.

Description the GPU-based DC load Flow solver

The GPU-based DC Load Flow solver serves the purpose of computing a large number of similar DC load flows in an
accelerated fashion. Currently the solver supports the following batch dimensions, i.e. the workload must not change
in anything other than these dimensions:
• Branch topology (assignment of branches to busbar A or B)
• Injection topology (assignment of injections to busbar A or B)
• Branch outages

Under the hood, it is using PTDF/(G)LODF/BSDF approaches to achieve this.

Roadmap

Next to some smaller improvements, current work focuses on broadening controllable asset support, improving preprocessing fidelity, and hardening the end-to-end optimization workflow. We will work on sharing a more high-level roadmap in the future.

Let us work together

We strongly believe that through joint development, collaboration and integration into other tools, we can jointly build an open-source topology optimizer that is fast, provides accurate recommendations and can be used by different TSOs to reduce grid congestion. Topology optimization works best when holistically applied to the grid and the different operational constraints from different TSOs are considered. This is why we invite you to share your feedback, constraints and your approaches so that we can jointly improve ToOp.

In addition, we also see the opportunity that ToOp can be combined with other open-source tools. If you have ideas, reach out to us.
We invite you to test it, ask questions and provide feedback to us. And if you like it, we invite you to contribute to the development. We are looking forward to hearing from you.

Finding help

If you require help with using this package, your first point of contact is ToOp@eliagroup.eu.

Contributing

Please have a look at our CONTRIBUTING.md.


License

Distributed under MPL 2.0. See LICENSE.

Citation

If you use our work in scientific research, please cite our paper on load flow solving or our paper on the optimizer architecture, depending what parts of the repository you use.


Contact

Team – ToOp


Acknowledgments

We credit the authors of JAX.

@software{jax2018github,
  author = {James Bradbury and Roy Frostig and Peter Hawkins and Matthew James Johnson and Chris Leary and Dougal Maclaurin and George Necula and Adam Paszke and Jake Vander{P}las and Skye Wanderman-{M}ilne and Qiao Zhang},
  title = {{JAX}: composable transformations of {P}ython+{N}um{P}y programs},
  url = {http://github.com/jax-ml/jax},
  version = {0.3.13},
  year = {2018},
}

Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 4 days ago

Total Commits: 259
Total Committers: 9
Avg Commits per committer: 28.778
Development Distribution Score (DDS): 0.714

Commits in past year: 259
Committers in past year: 9
Avg Commits per committer in past year: 28.778
Development Distribution Score (DDS) in past year: 0.714

Name Email Commits
dependabot[bot] 4****] 74
LeonHilf 1****f 43
Miha Sajko 4****o 41
nicow-elia 1****a 34
Sascha Petznick 2****a 25
siarhei s****k@g****m 22
Bpetrick 1****r 14
Copilot 1****t 4
Christian M. 9****a 2

Issue and Pull Request metadata

Last synced: 3 days ago

Total issues: 0
Total pull requests: 166
Average time to close issues: N/A
Average time to close pull requests: 8 days
Total issue authors: 0
Total pull request authors: 12
Average comments per issue: 0
Average comments per pull request: 1.31
Merged pull request: 54
Bot issues: 0
Bot pull requests: 85

Past year issues: 0
Past year pull requests: 166
Past year average time to close issues: N/A
Past year average time to close pull requests: 8 days
Past year issue authors: 0
Past year pull request authors: 12
Past year average comments per issue: 0
Past year average comments per pull request: 1.31
Past year merged pull request: 54
Past year bot issues: 0
Past year bot pull requests: 85

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/eliagroup/toop

Top Issue Authors

Top Pull Request Authors

  • dependabot[bot] (85)
  • LeonHilf (18)
  • nicow-elia (16)
  • BenjPetr (15)
  • spetznick-elia (14)
  • siarhei2000582 (5)
  • Copilot (4)
  • CesarBallardini (3)
  • spetznick (2)
  • mihasajko (2)
  • pet-mit (1)
  • blacksph3re (1)

Top Issue Labels

Top Pull Request Labels

  • dependencies (86)
  • python:uv (70)
  • github_actions (7)
  • docker_compose (3)
  • pre_commit (3)
  • docker (2)
  • ci (1)
  • enhancement (1)

Dependencies

.github/actions/run-package-tests/action.yaml actions
  • ./.github/actions/setup-python * composite
  • actions/upload-artifact b7c566a772e6b6bfb58ed0dc250532a479d7789f composite
.github/actions/install-uv/action.yaml actions
  • astral-sh/setup-uv 0098a7571ce5c86752e28c0868b41650866a8f4c composite
.github/workflows/docs.yaml actions
  • ./.github/actions/configure-git-profile * composite
  • ./.github/actions/setup-python * composite
  • actions/checkout 0c366fd6a839edf440554fa01a7085ccba70ac98 composite
.github/actions/configure-git-profile/action.yaml actions
.github/workflows/release.yaml actions
  • ./.github/actions/configure-git-profile * composite
  • ./.github/actions/setup-python * composite
  • actions/checkout 0c366fd6a839edf440554fa01a7085ccba70ac98 composite
packages/importer_pkg/uv.lock pypi
  • 220 dependencies
.github/workflows/ci.yaml actions
  • ./.github/actions/install-uv * composite
  • ./.github/actions/run-package-tests * composite
  • ./.github/actions/setup-python * composite
  • B1NARY-GR0UP/nwa 3e1823c61ba2818a156c77b4eedc7905d6a8557c composite
  • actions/cache 27d5ce7f107fe9357f9df03efb73ab90386fccae composite
  • actions/checkout 0c366fd6a839edf440554fa01a7085ccba70ac98 composite
  • actions/download-artifact 3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c composite
  • fossas/fossa-action ff70fe9fe17cbd2040648f1c45e8ec4e4884dcf3 composite
  • sonarsource/sonarqube-quality-gate-action 8e9b0ca0a7273d6f16986388d98393efdfcf56fd composite
  • sonarsource/sonarqube-scan-action 713881670b6b3676cda39549040e2d88c70d582e composite
.github/workflows/export-reqs.yaml actions
  • ./.github/actions/configure-git-profile * composite
  • ./.github/actions/install-uv * composite
  • actions/checkout 0c366fd6a839edf440554fa01a7085ccba70ac98 composite
.github/workflows/scorecard.yaml actions
  • actions/checkout 11bd71901bbe5b1630ceea73d27597364c9af683 composite
  • actions/upload-artifact 043fb46d1a93c77aae656e7c1c64a875d1fc6a0a composite
  • github/codeql-action/upload-sarif 3d8036cf7fe7433e4a725cf513a6ea56c7fd0f14 composite
  • ossf/scorecard-action 4eaacf0543bb3f2c246792bd56e8cdeffafb205a composite
packages/interfaces_pkg/uv.lock pypi
  • 186 dependencies
packages/topology_optimizer_pkg/uv.lock pypi
  • 273 dependencies
.github/actions/setup-python/action.yaml actions
  • ./.github/actions/install-uv * composite
  • actions/setup-python a309ff8b426b58ec0e2a45f0f869d46889d02405 composite
packages/contingency_analysis_pkg/pyproject.toml pypi
packages/grid_helpers_pkg/pyproject.toml pypi
uv.lock pypi
  • 316 dependencies
packages/grid_helpers_pkg/uv.lock pypi
  • 199 dependencies
packages/topology_optimizer_pkg/pyproject.toml pypi
pyproject.toml pypi
.github/workflows/validate_pr_title.yaml actions
Dockerfile docker
  • ghcr.io/astral-sh/uv 0.11.19@sha256 build
  • python 3.13.6-bullseye@sha256 build
packages/dc_solver_pkg/uv.lock pypi
  • 217 dependencies
packages/contingency_analysis_pkg/uv.lock pypi
  • 206 dependencies
packages/interfaces_pkg/pyproject.toml pypi
  • beartype (>=0.22.0,<0.23.0)
  • fonttools >=4.60.2
  • fsspec >=2024.0.0
  • h5py >=3.0.0
  • jaxtyping (>=0.2.22,<0.3.0)
  • mypy-protobuf >=3.7.0
  • numpy (>=1.26.0,<2.0.0)
  • numpydantic (>=1.6.4,<2.0.0)
  • pandas (>=2.2.3,<3.0.0)
  • pandera (>=0.22.1,<0.23.0)
  • polars >=1.33.0
  • protobuf >=5,<8
  • pyarrow >=21.0.0
  • pydantic (>=1.10.3,<3.0.0)
  • structlog (>=24.4.0,<25.0.0)
packages/dc_solver_pkg/pyproject.toml pypi
packages/importer_pkg/pyproject.toml pypi

Score: 6.851184927493742