Grid2Op is a simulation environment for fast, reproducible experiments on power grids. Use it to run large-scale powerflows, to train or evaluate "smart controllers" (heuristic, optimization-based, machine-learning, or any combination) under realistic operational constraints, or to model sequential decision-making in power systems.
Unless otherwise specified, all code hosted in the Grid2op organisation (https://github.com/grid2op) is licensed under the MPL v2 license, available at LICENSE.md or at https://mozilla.org/MPL/2.0/.
All code hosted in this organisation should also respect the CODE OF CONDUCT and follow the decisions of the Grid2op Technical Steering Committee (see the GOVERNANCE document for details).
To avoid the misuse of secrets (API keys, GitHub tokens, SSH private keys, etc.), we recommend that all packages follow the best practices in SECRETS MANAGEMENT. This is enforced for core packages.
The Grid2op ecosystem has two parts: core packages, which are well maintained, tested, and documented, and companion packages, which make the core packages easier to use, integrate them with other tools, or apply them to specific settings.
Using Grid2op for your own experiments and want to share your work? Open a discussion and we'll look at how it could fit into the ecosystem.
The current roadmap is available here: ROADMAP.
There are currently two core packages:
- grid2op — the core package. Pure Python, available on PyPI, and highly flexible: it allows extensive customization and ships default implementations for most of its components.
- lightsim2grid — a fast Grid2op "backend" / "computation engine". It implements the power-flow solvers in C++, optimized for speed and ease of use within Grid2op.
A non-exhaustive list of current companion packages:
- pypowsybl2grid — another Grid2op backend, under active development. It brings the full power of the PowSyBl framework, including its detailed power-grid simulation, into the ecosystem.
- chronix2grid — generates the time series used in Grid2op environments, providing load and generation values for every time step of an episode.
- l2rpn-baselines — code examples to get started training agents that control a power grid, for several reinforcement-learning frameworks.
- grid2game — a graphical interface that lets a human "play" Grid2op and act as an agent.
- grid2viz — a graphical interface for inspecting how a Grid2op agent performed across a set of scenarios, and for comparing an agent against a baseline.
- LearningToAlert — an algorithm for one part of the Grid2op action space: sending alerts to a human operator at the right moment.
- grid2op-milp-agent — an example Grid2op agent based on linear optimization that performs topological actions.
Other contributors develop code that could be hosted here. For example, top L2RPN performers often publish their approaches on GitHub — see the updated list of external contributions.
The ecosystem also includes packages hosted elsewhere, such as:
- a graphical interface developed by NVIDIA: https://github.com/NVIDIA/energy-sdk-l2rpn
- strong solutions to the L2RPN competitions, for example:
- a "backend" / "computation engine" based on dynamic simulation and the GridPACK framework: https://github.com/GridOPTICS/GridPACK/tree/grid2op_integration