# gridfm-datakit-v1: A Python Library for Scalable and Realistic Power Flow and Optimal Power Flow Data Generation

arXiv: https://arxiv.org/abs/2512.14658 · HTML: https://mlsanity.com/paper/2512.14658/

## Key facts

- Cited by 3 papers in the map (data through 14 Oct 2026).
- Builds on 14 of its 23 references that are in the map.
- First posted on arXiv 16 Dec 2025.

## Builds on (most cited first, 14 of 14)

- [Fast Graph Representation Learning with PyTorch Geometric](https://mlsanity.com/paper/1903.02428/) (2019)
- [The Power Grid Library for Benchmarking AC Optimal Power Flow Algorithms](https://mlsanity.com/paper/1908.02788/) (2019)
- [Self-Supervised Primal-Dual Learning for Constrained Optimization](https://mlsanity.com/paper/2208.09046/) (2022)
- [PowerModels.jl: An Open-Source Framework for Exploring Power Flow Formulations](https://mlsanity.com/paper/1711.01728/) (2017)
- [Foundation Models for the Electric Power Grid](https://mlsanity.com/paper/2407.09434/) (2024)
- [CANOS: A Fast and Scalable Neural AC-OPF Solver Robust To N-1 Perturbations](https://mlsanity.com/paper/2403.17660/) (2024)
- [OPFData: Large-scale datasets for AC optimal power flow with topological perturbations](https://mlsanity.com/paper/2406.07234/) (2024)
- [PowerFlowNet: Power Flow Approximation Using Message Passing Graph Neural Networks](https://mlsanity.com/paper/2311.03415/) (2023)
- [PowerGraph: A power grid benchmark dataset for graph neural networks](https://mlsanity.com/paper/2402.02827/) (2024)
- [OPF-Learn: An Open-Source Framework for Creating Representative AC Optimal Power Flow Datasets](https://mlsanity.com/paper/2111.01228/) (2021)
- [PGLearn -- An Open-Source Learning Toolkit for Optimal Power Flow](https://mlsanity.com/paper/2505.22825/) (2025)
- [Towards Generalization of Graph Neural Networks for AC Optimal Power Flow](https://mlsanity.com/paper/2510.06860/) (2025)
- [A Principled Framework to Evaluate Quality of AC-OPF Datasets for Machine Learning: Benchmarking a Novel, Scalable Generation Method](https://mlsanity.com/paper/2508.19083/) (2025)
- [A Weather Foundation Model for the Power Grid](https://mlsanity.com/paper/2509.25268/) (2025)

## Built on by (most cited first, 3 of 3)

- [GENCO - A Unified Neural Solver Embedded in a Development Framework for Steady-State Grid Analysis](https://mlsanity.com/paper/2608.09921/) (2026)
- [MxGPS: Multiplex Graph Transformers for a Power Grid Foundation Model](https://mlsanity.com/paper/2607.13763/) (2026)
- [Learning by Examples: Power Grid Steady State Analysis with a Tabular Foundation Model](https://mlsanity.com/paper/2610.20462/) (2026)

## Abstract (arXiv)

We introduce gridfm-datakit-v1, a Python library for generating realistic and diverse Power Flow (PF) and Optimal Power Flow (OPF) datasets for training Machine Learning (ML) solvers. Existing datasets and libraries face three main challenges: (1) lack of realistic stochastic load and topology perturbations, limiting scenario diversity; (2) PF datasets are restricted to OPF-feasible points, hindering generalization of ML solvers to cases that violate operating limits (e.g., branch overloads or voltage violations); and (3) OPF datasets use fixed generator cost functions, limiting generalization across varying costs. gridfm-datakit addresses these challenges by: (1) combining global load scaling from real-world profiles with localized noise and supporting arbitrary N-k topology perturbations to create diverse yet realistic datasets; (2) generating PF samples beyond operating limits; and (3) producing OPF data with varying generator costs. It also scales efficiently to large grids (up to 10,000 buses). Comparisons with OPFData, OPF-Learn, PGLearn, and PFDelta are provided. Available on GitHub at https://github.com/gridfm/gridfm-datakit under Apache 2.0 and via `pip install gridfm-datakit`.
