GridConnect
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,convergedisFalse, andfailed_time_stepsidentifies the unavailable profile rows.run_power_proxy(...)screens constraints using the power-proxy method.run_load_shift(process)applies a selectedmv,trafo,line,bus, orvoltage_riskload-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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gridconnect-0.2.1.tar.gz | 102.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gridconnect-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 218.6 kB
Release files / gridconnect-0.2.1.tar.gz
| Download URL | gridconnect-0.2.1.tar.gz |
|---|---|
| Size | 102.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
712b8d8c605bd4f90f7f8af0e963ff140609f4fd3397d3ef05334bbc3051106d
|
|
BLAKE2b-256 checksum How to use checksums |
906ce3148bc89e3b38dd12162f83b0e441deb38d00e3049dd351ab42a9a105e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.1-py3-none-any.whl
| Download URL | gridconnect-0.2.1-py3-none-any.whl |
|---|---|
| Size | 116.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a91abc175667d101b417c7d27a26929e90c5ebb0a0b17a841b71db2290fff3ee
|
|
BLAKE2b-256 checksum How to use checksums |
581aae83b0590ff0019e0027e2d888d6ba8f9785639ba127f3bd784a637dacf3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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}
|