Skip to main content

EnerGNN

PyPI Latest Release Documentation Status MPL-2.0 License Actions Status

A Graph Neural Network library based on JAX and Flax, specifically designed for real-life energy networks and large complex industrial infrastructures.

EnerGNN provides:

  • A Hyper Heterogeneous Multi Graph (H2MG) data representation.
  • A Graph Neural Network (GNN) library robust to structure variations (outages, reconfigurations, etc.).
  • A clear interface to apply GNNs to custom use-cases (optimization, simulation, etc.).

Documentation

You can find the full documentation on ReadTheDocs.

Installation

EnerGNN is available on PyPI for Python >= 3.11.

pip install energnn

If you want to install the extra GPU dependencies, use:

pip install energnn[gpu]

Quick Start

This example shows how to train a small GNN to solve a linear system (DC Power Flow) modeled as a graph.

import optax
from energnn.problem.example import LinearSystemProblemLoader
from energnn.model.ready_to_use import TinyRecurrentEquivariantGNN
from energnn.trainer import Trainer

# 1. Load a problem (DC Power Flow linear systems)
problem_loader = LinearSystemProblemLoader(seed=1)

# 2. Initialize a model
model = TinyRecurrentEquivariantGNN(
    in_structure=problem_loader.context_structure,
    out_structure=problem_loader.decision_structure,
)

# 3. Train the model
trainer = Trainer(model=model, gradient_transformation=optax.adam(1e-3))
trainer.train(train_loader=problem_loader, n_epochs=10)

# 4. Use the model
for problem_batch in problem_loader:
    context_batch, _ = problem_batch.get_context()
    decision_batch, _ = model.forward_batch(graph=context_batch)
    break

Development

To build this package locally from sources, we recommend using uv:

uv sync
# Or for GPU support
uv sync --extra gpu

Supporting Institutions

RTE Université de Liège INRIA

Cite Us

@software{energnn,
    author = {{Committers of EnerGNN}},
    title = {{EnerGNN: A Graph Neural Network library for real-life Energy networks.}},
    url = {https://github.com/energnn},
}

Metadata

Release files for energnn 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for energnn 0.4.0
File Size Uploaded
energnn-0.4.0.tar.gz 1.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for energnn 0.4.0
File Interpreter ABI Platform
energnn-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 1.2 MB

Release files / energnn-0.4.0.tar.gz

Download URL energnn-0.4.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
c64d24f9677910c0ac8a8338f3c722bc87a282193fe120e8f46399207696ad02
BLAKE2b-256 checksum
How to use checksums
fa1d79becf30a8c4f804b61d1e6bec17791feb0e8932e096c97bf95b86f84575
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / energnn-0.4.0-py3-none-any.whl

Download URL energnn-0.4.0-py3-none-any.whl
Size 89.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
19a57bd03b6f126c2213783e17c5b20a05f98bd613875b21dbca5580fd76a3a0
BLAKE2b-256 checksum
How to use checksums
dfc62f883b229322839d21ffb08e3c2bd9c7c678d4f628331c176479d5d9dd9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page