Skip to main content

Library to convert Common Grid Model Exchange Standard (CGMES) datasets to PowerGridModel (PGM) format

Project description

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.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cgmes2pgm_converter-0.4.2.tar.gz (65.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cgmes2pgm_converter-0.4.2-py3-none-any.whl (115.8 kB view details)

Uploaded Python 3

File details

Details for the file cgmes2pgm_converter-0.4.2.tar.gz.

File metadata

  • Download URL: cgmes2pgm_converter-0.4.2.tar.gz
  • Upload date:
  • Size: 65.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cgmes2pgm_converter-0.4.2.tar.gz
Algorithm Hash digest
SHA256 1de6bcd10fc25d8cb826682daa46054ae7cdeb18a21b2f023937f7bed81382a8
MD5 29bacf9dea4819ffa1286304eab9efd3
BLAKE2b-256 7275de7a07dce172c47de92ab998b7d422acd64d9f22fe17fe86c55361a9f505

See more details on using hashes here.

File details

Details for the file cgmes2pgm_converter-0.4.2-py3-none-any.whl.

File metadata

File hashes

Hashes for cgmes2pgm_converter-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 67a7a0634eca668d15a72fa0015333602a43c20e31d3c555a9b8aa72c2872c47
MD5 a19a88d0e25eb6266b8faa8e378b85d6
BLAKE2b-256 15ddfee7822825a24c39ef1d47283fdd89af6435d449a2bf4689f9f8f03e44e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page