This release is a pre-release and may not be stable for production use.
cimhub_matpower
Bidirectional converter between MATPOWER (.m case files) and CIM (IEC 61970) using the cim17v40 profile.
Usage
MATPOWER to CIM (Import)
import os
os.environ['CIMG_CIM_PROFILE'] = 'cim17v40'
from cimhub_matpower.importer.matpower_to_cim import matpower_to_cim
network = matpower_to_cim("case9.m")
CIM to MATPOWER (Export)
from cimhub_matpower.exporter.cim_to_matpower import cim_to_matpower
cim_to_matpower(network, "output.m")
Equipment Coverage
| MATPOWER Field | CIM Class(es) |
|---|---|
bus |
TopologicalNode, ConnectivityNode, BaseVoltage |
gen |
SynchronousMachine, GeneratingUnit |
branch |
ACLineSegment, PowerTransformer |
gencost |
GrossToNetActivePowerCurve |
areas |
ControlArea |
Unit Conventions
MATPOWER uses per-unit impedances on the system MVA base. The converter handles the z_base = base_kv² / base_mva conversion automatically — do not manually multiply by baseMVA.
Generator sign convention: MATPOWER Pg is positive for generation (power out). CIM Terminal.p is positive for power flowing into equipment — the converter negates when crossing the boundary.
Running Tests
uv run pytest cimhub_matpower/tests/ -v
Status
- Importer: functional for buses, generators, branches, gencost, areas.
- Exporter: implemented; full roundtrip tests in progress.
- Known gap: reactive power limits (
Qmin/Qmax) and transformer tap ratios need validation.
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 cimhub_matpower-2.0.0a1.tar.gz.
File metadata
- Download URL: cimhub_matpower-2.0.0a1.tar.gz
- Upload date:
- Size: 45.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a0a0939753d08d0d805c0facd8dd3c99d3d67226cc4c78684713428ab37b15a
|
|
| MD5 |
c4cfe376339afe8bd0694b08ea89214b
|
|
| BLAKE2b-256 |
fda0f355be5feb3d655c24e83d0dc7a761de793d47b69c451c89a4fd63f3099f
|
Provenance
The following attestation bundles were made for cimhub_matpower-2.0.0a1.tar.gz:
Publisher:
publish-cimhub-matpower.yml on PNNL-CIM-Tools/CIMHub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cimhub_matpower-2.0.0a1.tar.gz -
Subject digest:
6a0a0939753d08d0d805c0facd8dd3c99d3d67226cc4c78684713428ab37b15a - Sigstore transparency entry: 2523628804
- Sigstore integration time:
-
Permalink:
PNNL-CIM-Tools/CIMHub@1b73b91d85485ed800952094156d04858b0081d3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/PNNL-CIM-Tools
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-cimhub-matpower.yml@1b73b91d85485ed800952094156d04858b0081d3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file cimhub_matpower-2.0.0a1-py3-none-any.whl.
File metadata
- Download URL: cimhub_matpower-2.0.0a1-py3-none-any.whl
- Upload date:
- Size: 43.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f999e149f9cd157b7006c310569b637e37ca5c7afd62eb3443caf594a685085f
|
|
| MD5 |
ee290c8617b2e0b95f5256010de4fddb
|
|
| BLAKE2b-256 |
2950d7c98702de308ab1c584e5fc21688a4596884337835822a705082dbcb376
|
Provenance
The following attestation bundles were made for cimhub_matpower-2.0.0a1-py3-none-any.whl:
Publisher:
publish-cimhub-matpower.yml on PNNL-CIM-Tools/CIMHub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cimhub_matpower-2.0.0a1-py3-none-any.whl -
Subject digest:
f999e149f9cd157b7006c310569b637e37ca5c7afd62eb3443caf594a685085f - Sigstore transparency entry: 2523628856
- Sigstore integration time:
-
Permalink:
PNNL-CIM-Tools/CIMHub@1b73b91d85485ed800952094156d04858b0081d3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/PNNL-CIM-Tools
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-cimhub-matpower.yml@1b73b91d85485ed800952094156d04858b0081d3 -
Trigger Event:
workflow_dispatch
-
Statement type: