opfgym
A gymnasium-compatible framework to create reinforcement learning (RL) environment for solving the optimal power flow (OPF) problem. Contains five OPF benchmark environments for comparable research.
Science Score: 57.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 2 DOI reference(s) in README -
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.0%) to scientific vocabulary
Keywords
Repository
A gymnasium-compatible framework to create reinforcement learning (RL) environment for solving the optimal power flow (OPF) problem. Contains five OPF benchmark environments for comparable research.
Basic Info
- Host: GitHub
- Owner: Digitalized-Energy-Systems
- License: mit
- Language: Python
- Default Branch: development
- Homepage: https://opf-gym.readthedocs.io
- Size: 527 KB
Statistics
- Stars: 11
- Watchers: 0
- Forks: 2
- Open Issues: 9
- Releases: 8
Topics
Metadata Files
README.md
PyPi | Read the Docs | Github | mail
General
A set of benchmark environments to solve the Optimal Power Flow (OPF) problem with reinforcement learning (RL) algorithms. It is also easily possible to create custom OPF environments. All environments use the gymnasium API. The modelling of the power systems and the calculation of power flows happens with pandapower. The benchmark power grids and time-series data of loads and generators are taken from SimBench.
Documentation can be found on https://opf-gym.readthedocs.io/en/latest/.
If you want to use the benchmark environments or the general framework to build your own environments, please cite this repository (see CITATION.cff) and/or cite the following publication, where the framework is first mentioned (in an early stage): https://doi.org/10.1016/j.egyai.2024.100410
Environments
Currently, five OPF benchmark environments are available.
- EcoDispatch: Economic dispatch
- VoltageControl: Voltage Control with reactive power
- MaxRenewable: Maximize renewable feed-in
- QMarket: Reactive power market
- LoadShedding: Load shedding problem
Additionally, some
example environments for more advanced features can be found in opfgym/examples.
Contribution
Any kind of contribution is welcome! Feel free to create issues or merge
requests. Also, additional benchmark environment are highly appreciated. For
example, the examples environments could be refined to difficult but solvable
RL-OPF benchmarks. Here, it would be especially helpful to incorporate an OPF
solver that is more capable than the very limited pandapower OPF. For example,
it should be able to deal with multi-stage problems, discrete actuators like
switches, and stochastic problems, which the pandapower OPF cannot.
For questions, feedback, collaboration, etc., contact thomas.wolgast@uni-oldenburg.de.
Owner
- Name: Digitalized Energy Systems
- Login: Digitalized-Energy-Systems
- Kind: organization
- Website: uol.de/des
- Repositories: 1
- Profile: https://github.com/Digitalized-Energy-Systems
We are a research group of the University of Oldenburg in Germany dedicated to the resilient operation of digitalized energy systems.
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: OPF-Gym
date-released: 2025
message: >-
If you use this software, please cite it using the
metadata from this file. Additionally, please check out the publication
"Learning the optimal power flow: Environment design matters", where the
first version of the library was introduced.
(https://www.sciencedirect.com/science/article/pii/S2666546824000764)
type: software
authors:
- given-names: Thomas
family-names: Wolgast
email: thomas.wolgast@uni-oldenburg.de
affiliation: Carl von Ossietzky Universität Oldenburg
orcid: 'https://orcid.org/0000-0002-9042-9964'
repository-code: 'https://github.com/Digitalized-Energy-Systems/opfgym'
abstract: >-
The OPF-Gym library allows for easy creation of
reinforcement learning (RL) environments for solving the
optimal power flow (OPF) problem. OPF-Gym also provides
five benchmark environments to ensure comparability of
future RL-OPF research. Various kinds of OPF problems are
supported, for example, multi-stage OPF, discrete actions,
stochastic OPF, etc. Further, it is possible to generate
labeled training data for supervised learning, which again
improves comparability of research advances.
keywords:
- Optimal Power Flow
- Reinforcement Learning
- Environment Design
- Gymnasium
- Supervised Learning
- Voltage Control
- Economic Dispatch
- Reactive Power Market
- Load Shedding
- Power System
- Benchmark
license: MIT
version: 1.0.1
GitHub Events
Total
- Create event: 13
- Release event: 6
- Issues event: 41
- Watch event: 15
- Delete event: 11
- Issue comment event: 15
- Push event: 93
- Pull request event: 7
- Fork event: 1
Last Year
- Create event: 13
- Release event: 6
- Issues event: 41
- Watch event: 15
- Delete event: 11
- Issue comment event: 15
- Push event: 93
- Pull request event: 7
- Fork event: 1
Packages
- Total packages: 1
-
Total downloads:
- pypi 66 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 8
- Total maintainers: 1
pypi.org: opfgym
Reinforcement Learning environments for learning the Optimal Power Flow
- Homepage: https://opf-gym.readthedocs.io
- Documentation: https://opfgym.readthedocs.io/
- License: MIT License Copyright (c) 2022-Present Thomas Wolgast, Carl von Ossietzky Universität Oldenburg Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
Latest release: 1.0.1
published 11 months ago