Ctrl K

ePowCoRe

A generic representation of power grids, enabling open-source model conversion modules for common open and proprietary modeling tools.

1
mention
2
contributors
Get started
170 commitsLast commit ≈ 2 weeks ago6 stars5 forks

Cite this software

Description

⚡ ePowCoRe

A Generic Representation of Power Grids Enabling Open-Source Model Conversion Modules

Tests Python uv Documentation License DOI


Overview

ePowCoRe is a Python framework for converting electrical power-system models between different modeling and simulation environments.

At its core, ePowCoRe uses the Generic Data Format (GDF) as a platform-independent intermediate representation.

Source Model
     │
     ▼
┌─────────────────────┐
│ Generic Data Format │
│        (GDF)        │
└─────────────────────┘
     │
     ▼
Target Model

Using GDF as the intermediate representation separates platform-specific import and export logic from the generic grid model.

This allows conversion modules to operate around a common representation instead of implementing direct converters between every pair of supported platforms.


Installation

Requirements

  • Python 3.11
  • uv

The project currently declares:

Python >=3.11,<3.12

Clone the repository

git clone https://github.com/KIT-IAI/ePowCoRe.git
cd ePowCoRe

Install dependencies

Install the environment from the committed lock file:

uv sync --locked

Run Python inside the project environment with:

uv run python --version

Optional integrations

Additional dependency groups are available for specific integrations.

For PyPSA:

uv sync --locked --group pypsa

For MATLAB / Simscape:

uv sync --locked --group simscape

Usage

Conversion scripts are available in scripts/.

For example, to convert a PowerFactory model to GDF:

uv run python scripts/pf_to_gdf.py

To convert an existing GDF model to JMDL:

uv run python scripts/gdf_to_jmdl.py

Several conversion scripts currently contain model names, input paths, output paths, or other configuration directly in the script. Adjust the corresponding script for the model being converted before execution.

Generated models are typically written below:

output/

Supported Conversions

The repository currently provides scripts for the following conversion paths:

SourceTargetScript
PowerFactoryGDFpf_to_gdf.py
GDFPowerFactorygdf_to_pf.py
JMDLGDFjmdl_to_gdf.py
GDFJMDLgdf_to_jmdl.py
GDFGeoJSONgdf_to_geojson.py
PowerFactoryGeoJSONpf_to_geojson.py
GDFMATPOWERgdf_to_matpower.py
GDFpandapowergdf_to_pandapower.py
GDFPyPSAgdf_to_pypsa.py
GDFRSCAD / RTDSgdf_to_rscad.py
GDFSimscapegdf_to_simscape.py

Support depends on the available component mappings for each platform and conversion direction.

See the documentation for platform-specific details.


Project Structure

ePowCoRe/
│
├── epowcore/
│   ├── gdf/
│   ├── generic/
│   ├── geo_json/
│   ├── jmdl/
│   ├── matpower/
│   ├── pandapower/
│   ├── power_factory/
│   ├── rscad/
│   └── simscape/
│
├── scripts/
├── tests/
├── tests_slow/
├── documentation/
├── config/
│
├── pyproject.toml
├── uv.lock
├── .pre-commit-config.yaml
├── STYLEGUIDE.md
└── README.md

Package Overview

PathPurpose
epowcore/gdfGeneric Data Format and core power-system model
epowcore/genericPlatform-independent model operations
epowcore/geo_jsonGeoJSON conversion
epowcore/jmdlJMDL integration
epowcore/matpowerMATPOWER integration
epowcore/pandapowerpandapower integration
epowcore/power_factoryDIgSILENT PowerFactory integration
epowcore/rscadRSCAD / RTDS integration
epowcore/simscapeMATLAB Simscape integration
scriptsConversion and utility scripts
testsAutomated tests
tests_slowSlower or environment-dependent tests
documentationSphinx documentation sources

Development

Project dependencies and tool configuration are defined in:

pyproject.toml

Resolved dependency versions are stored in:

uv.lock

After modifying dependencies:

uv lock
uv sync

Commit both pyproject.toml and uv.lock when dependency resolution changes.


Testing

Core test suite

The GitHub Actions workflow runs:

uv run pytest tests/core

Run the same suite locally before submitting changes:

uv run pytest tests/core

Full test suite

To run the broader test suite:

uv run pytest tests/

Some integration tests require external software or platform-specific environments and may therefore not run on every development machine.

Coverage

Run tests with coverage:

uv run pytest --cov=epowcore tests/

Generate the XML coverage report:

uv run coverage xml

Code Quality

The repository uses Black and isort, configured through pyproject.toml.

Run all configured pre-commit hooks with:

uv run pre-commit run --all-files

Individual tools can also be run directly.

Black

uv run black epowcore tests

isort

uv run isort epowcore tests

Check for whitespace errors before committing:

git diff --check

Additional project conventions are documented in STYLEGUIDE.md.


Documentation

The documentation is hosted on Read the Docs:

https://epowcore.readthedocs.io/

Documentation sources are located in:

documentation/source/

Build the HTML documentation locally with:

uv run sphinx-build \
  -b html \
  documentation/source \
  documentation/build/html \
  -c documentation/source/

The generated documentation is available in:

documentation/build/html/

Citation

Software

If you use ePowCoRe in academic work, cite the archived software release:

DOI

Publication

M. Weber, A. Kocher, H. K. Çakmak, and V. Hagenmeyer, “ePowCoRe: A Novel Generic Representation of Power Grids Enabling Open-Source Model Conversion Modules,” 2024 Open Source Modelling and Simulation of Energy Systems (OSMSES), Vienna, Austria, 2024, pp. 1–6. doi: 10.1109/OSMSES62085.2024.10668981


License

ePowCoRe is distributed under the MIT License.

Keywords
Programming language
  • Python 100%
License
</>Source code

Participating organisations

Karlsruhe Institute of Technology (KIT)

Reference papers

Mentions

Contributors

AK
Alexander Kocher

Helmholtz Program-oriented Funding IV