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_<district>.parquet |
datetime, building_id, name, main_usage, district, and electricity_need (kW). |
| 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/.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gridconnect-0.2.0.tar.gz.
File metadata
- Download URL: gridconnect-0.2.0.tar.gz
- Upload date:
- Size: 101.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4aaa2b12d5c1e2bdc9970aa17a39fa17cf06524f7975b0372728646a75ad88e7
|
|
| MD5 |
22a91235c4312afc11f850eee9993004
|
|
| BLAKE2b-256 |
1a66dc710ff30f08164eda9b4cff5b4b4de39f0ac09a60406c293312d2525ebc
|
File details
Details for the file gridconnect-0.2.0-py3-none-any.whl.
File metadata
- Download URL: gridconnect-0.2.0-py3-none-any.whl
- Upload date:
- Size: 114.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
111dccd1e58c9a2768882a2738f157914b4f76a348b14bed8c96f1d77504eda5
|
|
| MD5 |
d690ffa2f079d7e1850c811e25c64305
|
|
| BLAKE2b-256 |
77a92d0058e70ea0bb7fc84d31134c54fd79232037cacb8ee396f613e845b6bc
|