cgmes2pgm-suite


Namecgmes2pgm-suite JSON
Version 0.2.1 PyPI version JSON
download
home_pageNone
SummaryAdditional tools for cgmes2pgm_converter to integrate PowerGridModel with the Common Grid Model Exchange Standard (CGMES)
upload_time2025-07-31 09:37:05
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12.3
licenseNone
keywords cgmes pgm state estimation power grid model
VCS
bugtrack_url
requirements bidict numpy pandas power-grid-model power-grid-model-io SPARQLWrapper XlsxWriter PyYAML StrEnum cgmes2pgm_converter rdflib docker
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CGMES2PGM-Suite

`cgmes2pgm_suite` provides additional tools for `cgmes2pgm_converter` to integrate [PowerGridModel](https://github.com/PowerGridModel/power-grid-model) with the Common Grid Model Exchange Standard (CGMES).
It focuses on performing the state estimation on CGMES datasets.

## Features

- Start an Apache Jena Fuseki as docker container
- Upload Datasets to a SPARQL endpoint
- Human readable exports of PGM Datasets in TXT and Excel
- Create SV-Profile from PGM Results
- Debug state estimation by manipulating datasets (e.g., subnet splitting)
- Configure conversion and state estimation via a configuration file
- Simulate measurements:
  - when real measurements are not provided via an Operation Profile, but a State Variable (SV) Profile is available
  - generates an Operation Profile with distorted measurements based on the SV Profile

## Installation

The package can be installed via pip:

```bash
pip install cgmes2pgm_suite
```

To start an Apache Jena Fuseki server via this package, Docker is required.
See [Docker installation guide](https://docs.docker.com/engine/install/).

## Usage

This package can be run as a standalone application, performing the conversion and running PGM's state estimation. To do so, you need to install the package and then run the following command:

```bash
python -m cgmes2pgm_suite --config <path_to_config_file>
```

The provided configuration file contains the dataset configuration and the parameters for the conversion and state estimation.
An example configuration file can be found in [/example](./example).

### Quick Start

For a quick start, we recommend cloning this project and using the provided test cases.

If the project is cloned, setup the environment and install the package:

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e ".[dev]"
pre-commit install
```

To run the Conformity Datasets, you need to download `Test Configurations v3.0.3` from [ENTSO-E CIM Conformity and Interoperability](https://www.entsoe.eu/data/cim/cim-conformity-and-interoperability/) respecting their License.
Place the rdf/xml files of each dataset in the respective subdirectory of `tests/datasets`.

Afterwards, you can run all datasets using:

```bash
pytest -m "integration"
```

> Note: Running the tests creates a Fuseki Docker container on port 3030.
> The container is automatically removed after the tests are finished.

The results of the tests can be found in the `tests/out` directory.

If you want to add your own datasets, the following steps are required:

- Place the rdf/xml files in the `tests/data/` directory
- Create a configuration file in the `tests/configs/` directory, by copying an existing one
- Update the name, output directory and location of the rdf/xml files in the new configuration file

### Datasets

The conversion, measurement simulation and state estimation has been tested with the CGMES conformity datasets.

The following datasets have been tested:

| Dataset | Size (Nodes) | Estimation Result | Comment |
| --- | --- | --- | --- |
| PowerFlow | 2 | 🟢 | |
| PST | 2 | 🟢 | All three Scenarios |
| MiniGrid | 13 | 🟢 | |
| MicroGrid | 13 | 🟢 | PST with AsymmetricalPhaseTapChanger (BE-TR2_2) has been split |
| SmallGrid | 167 | 🟢 | |
| Svedala | 191 | 🟢 | |
| RealGrid | 6051 | 🟡 | Requires smaller sigmas in measurement simulation to converge |
| FullGrid | 26 | ? | SV-Profile does not contain power flows for all branches, resulting in an insufficient amount of simulated measurements |

> Dataset Version: CGMES Conformity Assessment Scheme Test Configurations v3.0.2

The used configuration files can be found in the [/tests/configs](./tests/configs) directory.

## License

This project is licensed under the [Apache License 2.0](LICENSE.txt).

## Dependencies

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

- [cgmes2pgm_converter](https://pypi.org/project/cgmes2pgm_converter/) (Apache License 2.0)
- [bidict](https://pypi.org/project/bidict/) (Mozilla Public License 2.0)
- [numpy](https://pypi.org/project/numpy/) (BSD License)
- [pandas](https://pypi.org/project/pandas/) (BSD License)
- [power-grid-model](https://pypi.org/project/power-grid-model/) (Mozilla Public License 2.0)
- [power-grid-model-io](https://pypi.org/project/power-grid-model-io/) (Mozilla Public License 2.0)
- [SPARQLWrapper](https://pypi.org/project/SPARQLWrapper/) (W3C License)
- [XlsxWriter](https://pypi.org/project/XlsxWriter/) (BSD License)
- [PyYAML](https://pypi.org/project/PyYAML/) (MIT License)
- [StrEnum](https://pypi.org/project/StrEnum/) (MIT License)
- [docker](https://pypi.org/project/docker/) (Apache License 2.0)

This project includes code from [jena-fuseki-docker](https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-docker/)
in the `src/cgmes2pgm_suite/resources/docker` directory, which is redistributed under the original Apache License 2.0.
See the root‑level [`NOTICE`](./NOTICE) file for full attribution.

## 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](mailto:powergridmodel@soptim.de).

## Contributing

We welcome contributions to improve this project.
Please see our [Contributing Guide](CONTRIBUTING.md) 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](https://www.apache.org/foundation/policies/conduct).
We expect all contributors and users to follow these guidelines to ensure a welcoming and inclusive community.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cgmes2pgm-suite",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12.3",
    "maintainer_email": null,
    "keywords": "cgmes, pgm, State Estimation, Power Grid Model",
    "author": null,
    "author_email": "\"Lars Friedrich, Eduard Fried, Udo Schmitz\" <powergridmodel@soptim.de>",
    "download_url": "https://files.pythonhosted.org/packages/9d/cc/b01ebe4f35e11dc3d566a3d99b6a4c3abf8d0eece9c68bfd36e8c27730e2/cgmes2pgm_suite-0.2.1.tar.gz",
    "platform": null,
    "description": "# CGMES2PGM-Suite\n\n`cgmes2pgm_suite` provides additional tools for `cgmes2pgm_converter` to integrate [PowerGridModel](https://github.com/PowerGridModel/power-grid-model) with the Common Grid Model Exchange Standard (CGMES).\nIt focuses on performing the state estimation on CGMES datasets.\n\n## Features\n\n- Start an Apache Jena Fuseki as docker container\n- Upload Datasets to a SPARQL endpoint\n- Human readable exports of PGM Datasets in TXT and Excel\n- Create SV-Profile from PGM Results\n- Debug state estimation by manipulating datasets (e.g., subnet splitting)\n- Configure conversion and state estimation via a configuration file\n- Simulate measurements:\n  - when real measurements are not provided via an Operation Profile, but a State Variable (SV) Profile is available\n  - generates an Operation Profile with distorted measurements based on the SV Profile\n\n## Installation\n\nThe package can be installed via pip:\n\n```bash\npip install cgmes2pgm_suite\n```\n\nTo start an Apache Jena Fuseki server via this package, Docker is required.\nSee [Docker installation guide](https://docs.docker.com/engine/install/).\n\n## Usage\n\nThis package can be run as a standalone application, performing the conversion and running PGM's state estimation. To do so, you need to install the package and then run the following command:\n\n```bash\npython -m cgmes2pgm_suite --config <path_to_config_file>\n```\n\nThe provided configuration file contains the dataset configuration and the parameters for the conversion and state estimation.\nAn example configuration file can be found in [/example](./example).\n\n### Quick Start\n\nFor a quick start, we recommend cloning this project and using the provided test cases.\n\nIf the project is cloned, setup the environment and install the package:\n\n```bash\npython3 -m venv .venv\nsource .venv/bin/activate\npip install -r requirements.txt\npip install -e \".[dev]\"\npre-commit install\n```\n\nTo run the Conformity Datasets, you need to download `Test Configurations v3.0.3` from [ENTSO-E CIM Conformity and Interoperability](https://www.entsoe.eu/data/cim/cim-conformity-and-interoperability/) respecting their License.\nPlace the rdf/xml files of each dataset in the respective subdirectory of `tests/datasets`.\n\nAfterwards, you can run all datasets using:\n\n```bash\npytest -m \"integration\"\n```\n\n> Note: Running the tests creates a Fuseki Docker container on port 3030.\n> The container is automatically removed after the tests are finished.\n\nThe results of the tests can be found in the `tests/out` directory.\n\nIf you want to add your own datasets, the following steps are required:\n\n- Place the rdf/xml files in the `tests/data/` directory\n- Create a configuration file in the `tests/configs/` directory, by copying an existing one\n- Update the name, output directory and location of the rdf/xml files in the new configuration file\n\n### Datasets\n\nThe conversion, measurement simulation and state estimation has been tested with the CGMES conformity datasets.\n\nThe following datasets have been tested:\n\n| Dataset | Size (Nodes) | Estimation Result | Comment |\n| --- | --- | --- | --- |\n| PowerFlow | 2 | \ud83d\udfe2 | |\n| PST | 2 | \ud83d\udfe2 | All three Scenarios |\n| MiniGrid | 13 | \ud83d\udfe2 | |\n| MicroGrid | 13 | \ud83d\udfe2 | PST with AsymmetricalPhaseTapChanger (BE-TR2_2) has been split |\n| SmallGrid | 167 | \ud83d\udfe2 | |\n| Svedala | 191 | \ud83d\udfe2 | |\n| RealGrid | 6051 | \ud83d\udfe1 | Requires smaller sigmas in measurement simulation to converge |\n| FullGrid | 26 | ? | SV-Profile does not contain power flows for all branches, resulting in an insufficient amount of simulated measurements |\n\n> Dataset Version: CGMES Conformity Assessment Scheme Test Configurations v3.0.2\n\nThe used configuration files can be found in the [/tests/configs](./tests/configs) directory.\n\n## License\n\nThis project is licensed under the [Apache License 2.0](LICENSE.txt).\n\n## Dependencies\n\nThis project includes third-party dependencies, which are licensed under their own respective licenses.\n\n- [cgmes2pgm_converter](https://pypi.org/project/cgmes2pgm_converter/) (Apache License 2.0)\n- [bidict](https://pypi.org/project/bidict/) (Mozilla Public License 2.0)\n- [numpy](https://pypi.org/project/numpy/) (BSD License)\n- [pandas](https://pypi.org/project/pandas/) (BSD License)\n- [power-grid-model](https://pypi.org/project/power-grid-model/) (Mozilla Public License 2.0)\n- [power-grid-model-io](https://pypi.org/project/power-grid-model-io/) (Mozilla Public License 2.0)\n- [SPARQLWrapper](https://pypi.org/project/SPARQLWrapper/) (W3C License)\n- [XlsxWriter](https://pypi.org/project/XlsxWriter/) (BSD License)\n- [PyYAML](https://pypi.org/project/PyYAML/) (MIT License)\n- [StrEnum](https://pypi.org/project/StrEnum/) (MIT License)\n- [docker](https://pypi.org/project/docker/) (Apache License 2.0)\n\nThis project includes code from [jena-fuseki-docker](https://repo1.maven.org/maven2/org/apache/jena/jena-fuseki-docker/)\nin the `src/cgmes2pgm_suite/resources/docker` directory, which is redistributed under the original Apache License 2.0.\nSee the root\u2011level [`NOTICE`](./NOTICE) file for full attribution.\n\n## Commercial Support and Services\n\nFor organizations requiring commercial support, professional maintenance, integration services,\nor custom extensions for this project, these services are available from **SOPTIM AG**.\n\nPlease feel free to contact us via [powergridmodel@soptim.de](mailto:powergridmodel@soptim.de).\n\n## Contributing\n\nWe welcome contributions to improve this project.\nPlease see our [Contributing Guide](CONTRIBUTING.md) for details on how to submit pull requests, report issues, and suggest improvements.\n\n## Code of Conduct\n\nThis project adheres to a code of conduct adapted from the [Apache Foundation's Code of Conduct](https://www.apache.org/foundation/policies/conduct).\nWe expect all contributors and users to follow these guidelines to ensure a welcoming and inclusive community.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Additional tools for cgmes2pgm_converter to integrate PowerGridModel with the Common Grid Model Exchange Standard (CGMES)",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/SOPTIM/cgmes2pgm_suite",
        "Issues": "https://github.com/SOPTIM/cgmes2pgm_suite/issues",
        "Repository": "https://github.com/SOPTIM/cgmes2pgm_suite"
    },
    "split_keywords": [
        "cgmes",
        " pgm",
        " state estimation",
        " power grid model"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8fc07cd82982ad3568ed6cbafff957761e956ee19b1c0c019836afc058c0188f",
                "md5": "bfb89046ef0c6724f8aac5acb663b504",
                "sha256": "bb149471bb1e814d0ec0b90c8947214f6bf8a4909b3480ed91448ffffcc5ef3d"
            },
            "downloads": -1,
            "filename": "cgmes2pgm_suite-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bfb89046ef0c6724f8aac5acb663b504",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12.3",
            "size": 103052,
            "upload_time": "2025-07-31T09:37:04",
            "upload_time_iso_8601": "2025-07-31T09:37:04.089251Z",
            "url": "https://files.pythonhosted.org/packages/8f/c0/7cd82982ad3568ed6cbafff957761e956ee19b1c0c019836afc058c0188f/cgmes2pgm_suite-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "9dccb01ebe4f35e11dc3d566a3d99b6a4c3abf8d0eece9c68bfd36e8c27730e2",
                "md5": "7032a00657e1e01083ec97fd4a0a7b36",
                "sha256": "2be82eb5ae2ece9df15ad4ea158b11fc8a06e74cf493c5c9e1b4f0d69141be8d"
            },
            "downloads": -1,
            "filename": "cgmes2pgm_suite-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "7032a00657e1e01083ec97fd4a0a7b36",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12.3",
            "size": 68930,
            "upload_time": "2025-07-31T09:37:05",
            "upload_time_iso_8601": "2025-07-31T09:37:05.623039Z",
            "url": "https://files.pythonhosted.org/packages/9d/cc/b01ebe4f35e11dc3d566a3d99b6a4c3abf8d0eece9c68bfd36e8c27730e2/cgmes2pgm_suite-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-31 09:37:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SOPTIM",
    "github_project": "cgmes2pgm_suite",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "bidict",
            "specs": [
                [
                    "~=",
                    "0.23.1"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "~=",
                    "2.2.0"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "~=",
                    "2.2.0"
                ]
            ]
        },
        {
            "name": "power-grid-model",
            "specs": [
                [
                    "~=",
                    "1.11.37"
                ]
            ]
        },
        {
            "name": "power-grid-model-io",
            "specs": [
                [
                    "~=",
                    "1.3.7"
                ]
            ]
        },
        {
            "name": "SPARQLWrapper",
            "specs": [
                [
                    "~=",
                    "2.0.0"
                ]
            ]
        },
        {
            "name": "XlsxWriter",
            "specs": [
                [
                    "~=",
                    "3.2.0"
                ]
            ]
        },
        {
            "name": "PyYAML",
            "specs": [
                [
                    "~=",
                    "6.0.1"
                ]
            ]
        },
        {
            "name": "StrEnum",
            "specs": [
                [
                    "~=",
                    "0.4.15"
                ]
            ]
        },
        {
            "name": "cgmes2pgm_converter",
            "specs": [
                [
                    "~=",
                    "0.2.0"
                ]
            ]
        },
        {
            "name": "rdflib",
            "specs": [
                [
                    "~=",
                    "7.1.4"
                ]
            ]
        },
        {
            "name": "docker",
            "specs": [
                [
                    "~=",
                    "7.1.0"
                ]
            ]
        }
    ],
    "lcname": "cgmes2pgm-suite"
}
        
Elapsed time: 1.59168s