This release is a pre-release and may not be stable for production use.
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_pointsdict, are dropped with one warning. GDM fields with no cim18v17 home are untranscribed (logged atDEBUG); the list is in GDM_MAPPING.md section 10. - Export: a tape-shield cable raises, because GDM has no class for one. Exporting a model that
gdm_to_cimbuilt can raise on its current limits, because CIM-Builder'sadd_limit_typehas nodurationKindyet (see GDM_MAPPING.md section 14, item B22 b). - 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
- GDM to CIM mapping spec
- CIM to GDM export spec
- Tap assumptions both directions make
- Rewrite plan and export plan
- CIMHub architecture and converter API
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.0a3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cimhub_gdm-2.1.0a3.tar.gz | 104.1 kB | Without provenance | Details for cimhub_gdm-2.1.0a3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cimhub_gdm-2.1.0a3-py3-none-any.whl | Python 3 | none | any | Details for cimhub_gdm-2.1.0a3-py3-none-any.whl |
Total release size: 200.5 kB
Release files / cimhub_gdm-2.1.0a3.tar.gz
| Download URL | cimhub_gdm-2.1.0a3.tar.gz |
|---|---|
| Size | 104.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4c750c11059b32895e92e40e3bc6be4eed9ad33f422cedc17a8902f1422d4bd
|
|
BLAKE2b-256 checksum How to use checksums |
1c65c7c4309e5937fcc8a1301b08b782c243e481925c08f8fb8dd63470125381
|
| 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.0a3-py3-none-any.whl
| Download URL | cimhub_gdm-2.1.0a3-py3-none-any.whl |
|---|---|
| Size | 96.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5ddc0361a1cf2b1023ae37cd216ab7192d47f689f5c0d99a2fd6eb1dba763163
|
|
BLAKE2b-256 checksum How to use checksums |
bcde7a476a5133eb9215021680e8ad41feb301c4257a4f3133e26748f4eb92a3
|
| 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.0a3
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.