Skip to main content

GridForge

GridForge Logo

GridForge provides a small, explicit Python API for preparing standard PYPOWER/MATPOWER cases for power-system studies. It keeps the familiar case tables, gives them readable column names, preserves real bus IDs, and adds a few domain operations that are error-prone with raw NumPy arrays. You can directly use its output to formulate power system optimization problems.

Installation

Install the released package from PyPI:

pip install powergridforge

For development:

git clone https://github.com/xuwkk/gridforge.git
cd gridforge
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

To preview or check the documentation from the repository root:

python -m mkdocs serve
python -m mkdocs build --strict

The docs workflow publishes documentation changes from master to gh-pages. For first-time setup, choose Deploy from a branch and gh-pages under GitHub Settings → Pages.

Quick Start

import gridforge as gf
import pandas as pd

case = gf.load_case("case14")
bus = case["bus"]
solar = pd.DataFrame({"BUS_IDX": [2, 6], "PG": [20.0, 30.0]})
case.add_component("solar", solar)
solar_by_bus_mw = case.connection_matrix("solar") @ case["solar"]["PG"].to_numpy()
dc = case.dc_model()
ac = case.ac_model()
print(solar_by_bus_mw, dc.ptdf.shape, ac.Ybus.shape)

For a complete example, see the worked tutorial. The API reference lists the public operations; Cases and Tables defines what each file format preserves. The documentation site covers matrix axes, units, and AC/DC conventions.

GridForge is distributed under the MIT License.

Metadata

Release files for powergridforge 2.0.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 powergridforge 2.0.0
File Size Uploaded Provenance Actions
powergridforge-2.0.0.tar.gz 1.6 MB Without provenance Details for powergridforge-2.0.0.tar.gz

Built distribution (wheel)

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

Total release size: 1.6 MB

Release files / powergridforge-2.0.0.tar.gz

Download URL powergridforge-2.0.0.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
98431557428e8d2c69576445645f1c0cb927525f49ae1660910e796a4b0b4d80
BLAKE2b-256 checksum
How to use checksums
63bf6fcf35a8fd9c37badb4c5f3b6b03be52e0094de1144f562777e8ece54f07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / powergridforge-2.0.0-py3-none-any.whl

Download URL powergridforge-2.0.0-py3-none-any.whl
Size 31.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0795fde4998b4e0ae503440cabddd32d32a430503974fc8c742ae2f69e1f5b51
BLAKE2b-256 checksum
How to use checksums
bcefe030a4a30b97882f2d0faf2bdfbede1f6b85dbdd7ef0aecc10cfb97ca88c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Security for powergridforge 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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