Skip to content

Commit ac73eeb

Browse files
committed
improved doc
1 parent 21a3baa commit ac73eeb

File tree

14 files changed

+141
-34
lines changed

14 files changed

+141
-34
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ opf_data/data
2020
test_data/
2121
scripts/datasets_sampled/
2222
pfdelta/data/
23+
site/

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
- id: check-yaml
88
- id: debug-statements
99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.13.3
10+
rev: v0.14.10
1111
hooks:
1212
- id: ruff-check
1313
- id: ruff-format
@@ -17,7 +17,7 @@ repos:
1717
- id: flake8
1818
args: ["--ignore=E501,W503,E203"]
1919
- repo: https://github.com/asottile/add-trailing-comma
20-
rev: v3.2.0
20+
rev: v4.0.0
2121
hooks:
2222
- id: add-trailing-comma
2323
- repo: https://github.com/ibm/detect-secrets

.secrets.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2025-10-03T08:52:13Z",
6+
"generated_at": "2025-12-28T17:31:41Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,44 @@
1313
![License](https://img.shields.io/badge/license-Apache%202.0-blue)
1414

1515

16-
This library is brought to you by the GridFM team to generate power flow data to train machine learning and foundation models.
16+
---
17+
18+
# GridFM DataKit
19+
20+
**GridFM DataKit** (`gridfm-datakit`) is a Python library for generating realistic, diverse, and scalable synthetic datasets for power flow (PF) and optimal power flow (OPF) machine learning solvers. It unifies state-of-the-art methods for perturbing loads, generator dispatches, network topologies, and branch parameters, addressing limitations of existing data generation libraries.
21+
22+
## Key Features
23+
24+
* **Scalable**: Supports grids with up to 30,000 buses for PF and 10,000 buses for OPF. Compatible with MATPOWER (`.m`) files and the PGLib dataset.
25+
* **Realistic load scenarios**: Combines global scaling from real-world aggregated profiles with localized per-bus noise, preserving temporal and spatial correlations.
26+
* **Flexible topology perturbations**: Handles arbitrary (N-k) outages for lines, transformers, and generators, ensuring feasible network states.
27+
* **Generator cost diversity**: Permutes or randomly scales generator cost functions when solving OPF to produce diverse dispatches and improve generalization across different cost conditions.
28+
* **Out-of-operating-limits scenarios for PF**: PF datasets include realistic violations of operating limits (e.g., voltage or branch overloads) resulting from topology and load perturbations without re-optimizing generator dispatch.
29+
* **Admittance perturbations**: Randomly scales branch resistances and reactances to enhance diversity.
30+
* **Structured outputs for ML**: Per-bus, per-branch, and per-generator data ready for training neural PF/OPF solvers, with pre-computed DC-PF and DC-OPF baselines and runtime.
31+
* **Data validation and benchmarking**: Includes CLI tools for consistency checks, statistics, and constraint validation.
32+
33+
34+
<p align="center">
35+
<img src="https://raw.githubusercontent.com/gridfm/gridfm-datakit/refs/heads/main/docs/figs/comparison_table.png" alt="Comparison table" style="width: 40%; height: auto;"/>
36+
<br/>
37+
</p>
38+
39+
## Citation
40+
41+
Please cite the library when using it in your work:
42+
43+
```bibtex
44+
@misc{puech2025gridfmdatakitv1pythonlibraryscalable,
45+
title={gridfm-datakit-v1: A Python Library for Scalable and Realistic Power Flow and Optimal Power Flow Data Generation},
46+
author={Alban Puech and Matteo Mazzonelli and Celia Cintas and Tamara R. Govindasamy and Mangaliso Mngomezulu and Jonas Weiss and Matteo Baù and Anna Varbella and François Mirallès and Kibaek Kim and Le Xie and Hendrik F. Hamann and Etienne Vos and Thomas Brunschwiler},
47+
year={2025},
48+
eprint={2512.14658},
49+
archivePrefix={arXiv},
50+
primaryClass={cs.LG},
51+
url={https://arxiv.org/abs/2512.14658},
52+
}
53+
```
1754

1855
---
1956

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Admittance Perturbations
2+
3+
4+
## Base Classes
5+
6+
### `AdmittanceGenerator`
7+
8+
::: gridfm_datakit.perturbations.admittance_perturbation.AdmittanceGenerator
9+
10+
## Concrete Implementations
11+
12+
### `NoAdmittancePerturbationGenerator`
13+
14+
::: gridfm_datakit.perturbations.admittance_perturbation.NoAdmittancePerturbationGenerator
15+
16+
### `PerturbAdmittanceGenerator`
17+
18+
::: gridfm_datakit.perturbations.admittance_perturbation.PerturbAdmittanceGenerator
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Generator Perturbations
2+
3+
## Base Classes
4+
5+
### `GenerationGenerator`
6+
7+
::: gridfm_datakit.perturbations.generator_perturbation.GenerationGenerator
8+
9+
## Concrete Implementations
10+
11+
### `NoGenPerturbationGenerator`
12+
13+
::: gridfm_datakit.perturbations.generator_perturbation.NoGenPerturbationGenerator
14+
15+
### `PermuteGenCostGenerator`
16+
17+
::: gridfm_datakit.perturbations.generator_perturbation.PermuteGenCostGenerator
18+
19+
### `PerturbGenCostGenerator`
20+
21+
::: gridfm_datakit.perturbations.generator_perturbation.PerturbGenCostGenerator

docs/components/power_balance.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Power Balance
2+
3+
This module provides functions for computing power flow balance and branch admittances.
4+
5+
## Functions
6+
7+
### `compute_branch_admittances`
8+
9+
::: gridfm_datakit.utils.power_balance.compute_branch_admittances
10+
11+
### `compute_branch_powers_vectorized`
12+
13+
::: gridfm_datakit.utils.power_balance.compute_branch_powers_vectorized
14+
15+
### `compute_bus_balance`
16+
17+
::: gridfm_datakit.utils.power_balance.compute_bus_balance

docs/components/utils.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
This module provides utility functions for the project.
44

5+
## Functions
6+
7+
### `get_num_scenarios`
8+
9+
::: gridfm_datakit.utils.utils.get_num_scenarios
10+
11+
### `read_partitions`
12+
13+
::: gridfm_datakit.utils.utils.read_partitions
14+
515
### `write_ram_usage_distributed`
616

717
::: gridfm_datakit.utils.utils.write_ram_usage_distributed

docs/figs/comparison_table.png

310 KB
Loading

docs/figs/pipeline_docs.png

-852 KB
Binary file not shown.

0 commit comments

Comments
 (0)