Skip to main content

GridConnect

Python Package manager Tests

GridConnect connects simulated building electricity demand to representative distribution networks and prepares pandapower networks for electrical studies.

Full reference documentation: https://pages.persee.minesparis.psl.eu/planeterr/gridconnect/.

Main APIs

BuildingBusMatcher

BuildingBusMatcher assigns simulated buildings to the low- or medium-voltage buses of a named pandapower feeder. It uses building, demand-profile, district, and ORE line-geometry datasets, and returns a feeder-specific connection table.

from gridconnect.api.building_bus_matcher import BuildingBusMatcher
from gridconnect.matching.config import BuildingBusMatchConfig

matcher = BuildingBusMatcher(network, BuildingBusMatchConfig(...))
connections = matcher.run()

connections is a pandas/GeoPandas DataFrame with this stable schema:

Field Description
cleabs, building_id, main_usage, floor_area Building identifiers and characteristics.
annual_energy_mwh, peak_active_power_mw, peak_reactive_power_mvar, peak_apparent_power_mva Building demand.
district, mv_feeder Source district and target feeder.
bus, voltage_level, grid_distance Selected bus, LV/MV assignment, and connection distance in metres.

NetworkManager

NetworkManager is the stateful API for populating a pandapower network with loads, evaluating constraints, and applying corrective actions. Load creation, load shifting, reinforcement, and reconfiguration modify the managed network.

from gridconnect.api.manager import NetworkManager

manager = NetworkManager.from_network(network)
load_profiles = manager.create_loads(
    connections=connections,
    profiles=profiles,
)
constraints = manager.run_power_flow()

Key operations:

  • create_loads(...) imports one network load per valid building connection.
  • run_power_flow(...) runs AC power flow and returns constraint results. If some steps fail, valid results are retained for converged steps, converged is False, and failed_time_steps identifies the unavailable profile rows.
  • run_power_proxy(...) screens constraints using the power-proxy method.
  • run_load_shift(process) applies a selected mv, trafo, line, bus, or voltage_risk load-shifting process.
  • run_reinforcement(...) reinforces constrained lines and/or transformers.
  • run_reconfiguration(...) screens all profile rows with the power proxy and validates selected rows with AC power flow before iterating load shifting and reinforcement. After every network change, it re-screens all active profiles, selects fresh critical rows (or highest-power fallback rows), and validates them with AC power flow. If AC validation fails, it retains the fresh full-profile proxy constraints. It returns constraints before and after the process plus accumulated changes.

Input data

GridConnect expects a named pandapower distribution network plus the following data. Default paths are configurable through BuildingBusMatchConfig and NetworkManager.

Input Format Required content
Building data District Parquet files Building identifiers, geometry, usage, and floor area.
Load profiles energy_model_static_<district>.parquet and energy_model_hourly_<district>.parquet (building_eload >= 0.6.0), or a single legacy energy_model_<district>.parquet Static: building_id, name, main_usage, district, total_electricity_need, and floor_area. Hourly: building_id, datetime, and electricity_need (kW). A legacy file holds all of these columns.
Building-to-bus connections Parquet or DataFrame The connection schema returned by BuildingBusMatcher.
District areas Parquet District geometry used to resolve the feeder study area.
ORE network geometries Parquet Low- and medium-voltage overhead and underground line geometries.

For in-memory load creation, pass both DataFrames together:

manager.create_loads(connections=connections, profiles=profiles)

For file-based loading, provide a connection Parquet file and a directory of district profile files:

manager.create_loads(
    building_bus_file="path/to/building_bus_match.parquet",
    load_profiles_dir="path/to/load_profiles",
)

Output data

The matching workflow produces a building-to-bus connection table. The network workflow adds loads to the supplied pandapower network and returns typed result containers containing:

  • Time-indexed load profiles and maximum load powers.
  • Line-current, transformer-power, and bus-voltage constraint results.
  • Load-shift events and line/transformer reinforcement records.
  • Network snapshots and before/after reconfiguration comparisons.

Power values are represented in MW, Mvar, or MVA as named; line current is in kA, voltage is per unit, and matching distance is in metres.

Build the full documentation

Install the documentation dependencies from the repository root:

uv sync --extra docs

Preview the documentation locally:

uv run mkdocs serve

Build the deployable static site with strict validation:

uv run mkdocs build --strict

The generated site is written to site/.

Metadata

Release files for gridconnect 0.2.2

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

Source distribution (sdist)

Source distribution for gridconnect 0.2.2
File Size Uploaded
gridconnect-0.2.2.tar.gz 102.7 kB Details

Built distribution (wheel)

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

Total release size: 219.0 kB

Release files / gridconnect-0.2.2.tar.gz

Download URL gridconnect-0.2.2.tar.gz
Size 102.7 kB
Tags Source
SHA-256 checksum
How to use checksums
24012ce99c659d5d2917ac85ba70113e9f6cbd9a467a114f1983fcb255f81b1e
BLAKE2b-256 checksum
How to use checksums
97ac19ff2bedfe639bfe99761b8364265268aa2a97196a7a4060ec861cf9761d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / gridconnect-0.2.2-py3-none-any.whl

Download URL gridconnect-0.2.2-py3-none-any.whl
Size 116.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae1c2505eed8eefee88c36bb678edf0c7cf5cb8d730ead580f266e2f5d387b27
BLAKE2b-256 checksum
How to use checksums
263aae40c0c856cb980044a072cf5b55f98cd65cdb590897913c588f73e5c2cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.24 {"installer":{"name":"uv","version":"0.12.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","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.2.2 This release

2 release files

0.2.1

2 release files

0.2.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