Skip to main content

CGMES2PGM-Converter

cgmes2pgm_converter provides a library to convert Common Grid Model Exchange Standard (CGMES) datasets to PowerGridModel format. It was designed to apply the PGM State Estimation on a CGMES dataset. The CGMES dataset is fetched from a SPARQL endpoint and converted to a PGM dataset. This converter works with CGMES 3.0 / CIM 100 datasets, as well as CGMES 2.4 / CIM 16 datasets.

Methods to substitute additional measurements are included as well to improve state estimation (e.g. passive nodes). cgmes2pgm_suite provides additional tools for working with CGMES and PGM.

Project Status

The SOPTIM PGM Converter is provided by SOPTIM AG.

This repository is intentionally kept small and primarily serves demonstration, evaluation, and reproducibility purposes. While SOPTIM AG actively develops solutions in the area of power system analysis and grid data integration, this repository is not intended to represent the full functionality, performance, or support offering of commercial SOPTIM products.

The code is made available under the Apache-2.0 license. The availability of this repository does not imply any warranty, maintenance obligation, support commitment, or product roadmap by SOPTIM AG.

For additional information please contact SOPTIM AG directly.

Getting Started

The package can be installed from PyPI using pip:

pip install cgmes2pgm_converter

Set up the CGMES-Model

The CGMES-Model needs to be imported as a dataset into a triplestore providing a SPARQL endpoint (e.g. Apache Jena Fuseki).

Currently, the CGMES model needs to be stored in the default graph of the dataset. This approach may be updated in future versions.

Conversion

from cgmes2pgm_converter import CgmesToPgmConverter, CgmesDataset

dataset = CgmesDataset(
    base_url="http://localhost:3030/dataset_name",
    cim_namespace="http://iec.ch/TC57/2013/CIM-schema-cim16#", # for CGMES 2.4
    # "http://iec.ch/TC57/CIM100#", # for CGMES 3.0
)

converter = CgmesToPgmConverter(datasource=dataset)
input_data, extra_info = converter.convert()

See cgmes2pgm_suite for an complete example of how to use the converter.

Supported CGMES Classes

The following list of CGMES classes is supported by the converter:

  • All Branches (ACLineSegment, EquivalentBranch)
  • Links (Switch, Breaker, Disconnector)
  • Transformers (2-Winding, 3-Winding)
    • RatioTapchanger
    • PhaseTapChangerTabular
    • PhaseTapChangerLinear, -Symmetrical, -Asymmetrical
  • Measurements (P, Q, U, I*)
  • Generators & Loads
    • SynchronousMachine, AsynchronousMachine
    • ExternalNEtworkInjection
    • EnergyConsumer
    • StaticVarCompensator
  • Shunts (Linear-, NonlinearShuntCompensator)
  • DC Components
    • CsConverter, VsConverter
    • Replaced by loads since PGM does not support DC Components

* Used to create Q-measurements

License

This project is licensed under the Apache License 2.0.

Dependencies

This project includes third-party dependencies, which are licensed under their own respective licenses.

Development

For local development, the package can be installed from source:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .
pre-commit install

Commercial Support and Services

For organizations requiring commercial support, professional maintenance, integration services, or custom extensions for this project, these services are available from SOPTIM AG.

Please feel free to contact us via powergridmodel@soptim.de.

Contributing

We welcome contributions to improve this project. Please see our Contributing Guide for details on how to submit pull requests, report issues, and suggest improvements.

Code of Conduct

This project adheres to a code of conduct adapted from the Apache Foundation's Code of Conduct. We expect all contributors and users to follow these guidelines to ensure a welcoming and inclusive community.

Metadata

Release files for cgmes2pgm-converter 0.4.5

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

Source distribution (sdist)

Source distribution for cgmes2pgm-converter 0.4.5
File Size Uploaded
cgmes2pgm_converter-0.4.5.tar.gz 66.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cgmes2pgm-converter 0.4.5
File Interpreter ABI Platform
cgmes2pgm_converter-0.4.5-py3-none-any.whl Python 3 none any Details

Total release size: 182.9 kB

Release files / cgmes2pgm_converter-0.4.5.tar.gz

Download URL cgmes2pgm_converter-0.4.5.tar.gz
Size 66.9 kB
Tags Source
SHA-256 checksum
How to use checksums
688293498bf95dc4a0d012dcbb2ba0f3c150ec176c613320647f73834c0f76f4
BLAKE2b-256 checksum
How to use checksums
04579b5dee153e2269ec65e0db97baee84ba4ce1435bf0eed47c59cfb6d4125e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / cgmes2pgm_converter-0.4.5-py3-none-any.whl

Download URL cgmes2pgm_converter-0.4.5-py3-none-any.whl
Size 116.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
232a0bd00320f9ebc56ad3843cafef8a31c0605de8d94c7d56851522d6d442af
BLAKE2b-256 checksum
How to use checksums
f6a83943ee3d945b601999f73587bdc15a7633d10dfb42af5338e480a06bddfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3
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