CIMHub DistOPF¶
Converter between DistOPF (Distributed Optimal Power Flow) CSV data and CIM (IEC 61968/61970).
DistOPF is a distribution-level OPF solver that uses a linearized power flow formulation. This package reads DistOPF CSV case data and exports CIM models to the DistOPF CSV format. The DistOPF CSV layout is described by a LinkML schema that serves as the single source of truth for both the data structure and its serialization formatting.
Features¶
- CIM → DistOPF CSV export — write a CIM
FeederModelout as the per-type CSV files DistOPF consumes (bus_data,branch_data,gen_data,cap_data,bat_data,reg_data,schedules). - DistOPF CSV reader — parse a DistOPF case directory into typed LinkML records.
- LinkML-defined format — every CSV column, type, and default is defined in the LinkML schema, and the same schema drives the generated Schema Reference.
Importer is a work in progress
distopf_to_cim currently returns parsed DistOPF LinkML records rather than fully
constructed CIM objects; the per-type CIM importer converters are being wired into
the importer registry. The exporter (cim_to_distopf) is the mature path today.
Installation¶
Quick Start¶
import os
os.environ['CIMG_USE_UNITS'] = 'TRUE'
os.environ['CIMG_CIM_PROFILE'] = 'cimhub_2026'
from cimhub_distopf.exporter.cim_to_distopf import cim_to_distopf
# Export a CIM FeederModel → DistOPF CSV files
cim_to_distopf(feeder, "/path/to/output/")