Skip to main content

cimhub-gdm

grid-data-models (GDM) converter for CIMHub: a GDM DistributionSystem to and from CIM (cim18v17).

GDM has no file format of its own. Its native model is typed pydantic objects with pint quantities. So this package is builder-native: GdmImporter().to_cim(system) calls CIM-Builder's keyword methods directly and writes no .cimtbl file. The tests compare the result with reviewed .cimtbl goldens. The exporter reads every value through the cimhub-core getters.

pip install --pre cimhub-gdm      # also installs cimhub-core

Python 3.11 or later.

Quickstart

from cimhub_gdm import gdm_to_cim, read_gdm

system = read_gdm("system.json")             # a GDM DistributionSystem saved as JSON
system.name = system.name or "my_feeder"     # the CIM Model name; a system saved without one has none
network = gdm_to_cim(system)

Time series

Load time series map onto nc_schedule EnergyConnectionSchedules when you pass a time_points dict. The schedules go in the CIM XML; their points go in Parquet beside it, one row per point keyed by the schedule's uri, never as graph objects. See docs/TIMESERIES_NEEDS.md.

from cimgraph.utils import write_xml
from cimhub_gdm import GdmExporter, gdm_to_cim, read_time_points, write_time_points

time_points = {}  # filled: {"EnergyConnectionTimePoint": pyarrow.Table}
feeder_model = gdm_to_cim(system, time_points=time_points)
write_xml(feeder_model, "feeder.xml")
write_time_points(time_points, "feeder.xml")

time_points = read_time_points("feeder.xml", reloaded_model)
system = GdmExporter(time_points).to_model(reloaded_model)

Export goes the other way:

Function Purpose
GdmExporter().to_model(network, *, name_source=None, system_name=None) returns a GDM DistributionSystem
cim_to_gdm(network, destination, **opts) the same, written as GDM JSON
read_gdm(path), write_gdm(system, path) GDM JSON in and out

name_source is 'name', 'mrid' or 'uri' (default $CIMHUB_NAME_SOURCE, else 'mrid'). system_name names the system; without it the model's one Feeder names it, and a model with several Feeders raises.

What is supported

Family Import Export
Network shell (feeders, substations) and buses yes yes
Voltage sources yes yes
Switches, fuses, reclosers yes yes
Lines: matrix, sequence and geometry impedance, with wire and cable catalogs yes yes (bare and concentric-neutral wire)
Loads yes yes
Capacitors and their controllers yes yes
Transformers (tank-configuration templates, center taps, off-nominal taps) yes yes
Regulators, tap changers and controls yes yes
Solar and battery DER with inverter and battery data yes yes (one GDM DER per unit of a hybrid inverter)
Series reactors yes yes

What raises or is dropped:

  • Import: inverter controllers, the daily-timed capacitor controller and earthing switches raise as pending, naming what they wait for. Other time series, and load time series imported without a time_points dict, are dropped with one warning. GDM fields with no cim18v17 home are untranscribed (logged at DEBUG); the list is in GDM_MAPPING.md section 10.
  • Export: a tape-shield cable raises, because GDM has no class for one. A line or switch that CIM gives no rating exports at 400 A (OpenDSS's normamps default) and is named in the export's warning; an unrated fuse raises.
  • The exported system writes and solves through ditto's OpenDSS writer, which has no battery writer.

The import needs CIM-Builder's add_transformer_tank_end method, SeriesCompensatorBuilder and EnergyConnectionScheduleBuilder. The output survives a cim18v17 XML round trip unchanged.

Documentation

BSD 3-Clause. Source and issues: https://github.com/PNNL-CIM-Tools/CIMHub.

License and attribution

BSD 3-Clause. See LICENSE. Contributors are listed in AUTHORS.

This software was created under a project sponsored by the U.S. Department of Energy's Office of Electricity, an agency of the United States Government. Neither the United States Government nor the United States Department of Energy, nor Battelle, nor any of their employees, nor any jurisdiction or organization that has cooperated in the development of these materials, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness or any information, apparatus, product, software, or process disclosed, or represents that its use would not infringe privately owned rights.

PACIFIC NORTHWEST NATIONAL LABORATORY
operated by BATTELLE
for the UNITED STATES DEPARTMENT OF ENERGY
under Contract DE-AC05-76RL01830

Metadata

Release files for cimhub_gdm 2.1.0

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

Source distribution (sdist)

Source distribution for cimhub_gdm 2.1.0
File Size Uploaded Provenance Actions
cimhub_gdm-2.1.0.tar.gz 105.3 kB Without provenance Details for cimhub_gdm-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cimhub_gdm 2.1.0
File Interpreter ABI Platform Actions
cimhub_gdm-2.1.0-py3-none-any.whl Python 3 none any Details for cimhub_gdm-2.1.0-py3-none-any.whl

Total release size: 202.1 kB

Release files / cimhub_gdm-2.1.0.tar.gz

Download URL cimhub_gdm-2.1.0.tar.gz
Size 105.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d6cffb6fb811c0f5e67fa85fc2ce886dc5bdfac8c6e8dde4eb92a93b9358397e
BLAKE2b-256 checksum
How to use checksums
4517fb57f460089fc57d3bee3045f5e7e4f5b6a17c534171df4d68b48a59d029
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cimhub_gdm-2.1.0-py3-none-any.whl

Download URL cimhub_gdm-2.1.0-py3-none-any.whl
Size 96.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef2c56bc0a4659099ebb84609b0cc2bd16832dc56e56a21256964eb8ebf15a75
BLAKE2b-256 checksum
How to use checksums
94a663130cfc1b2cc0b922e6486cedda082203e74443c3471e9e3e8b118f981f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cimhub_gdm 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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