Metadata-Version: 2.4
Name: cimhub_distopf
Version: 2.0.0a0
Summary: CIMHub DistOPF Library
Author-email: Pacific Northwest National Laboratory <gridappsd@pnnl.gov>
License: BSD-2-Clause
Project-URL: Homepage, https://github.com/PNNL-CIM-Tools/CIMHub_2_0
Project-URL: Bug Tracker, https://github.com/PNNL-CIM-Tools/CIMHub_2_0/issues
Project-URL: Documentation, https://cimhub-distopf.readthedocs.io/
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: cimhub_core<2.1,>=2.0.0a0
Requires-Dist: pandas>=2.3.3

# cimhub_distopf

Converter between DistOPF (Distributed Optimal Power Flow) and CIM (IEC 61968/61970).

DistOPF is a distribution-level OPF solver that uses a linearized power flow formulation. This package imports DistOPF case data into CIM and exports CIM models to the DistOPF format.

## Usage

### DistOPF to CIM (Import)

```python
import os
os.environ['CIMG_USE_UNITS'] = 'TRUE'
os.environ['CIMG_CIM_PROFILE'] = 'cimhub_2026'

from cimhub_distopf.importer.distopf_to_cim import distopf_to_cim

network = distopf_to_cim("/path/to/case/")
```

### CIM to DistOPF (Export)

```python
from cimhub_distopf.exporter.cim_to_distopf import cim_to_distopf

cim_to_distopf(network, "/path/to/output/")
```

## Architecture

```
LinkML YAML  →  distopf_schema.py  →  GraphModel  →  DistopfReader / DistopfWriter
                                            ↕
                                  DistopfImporter / DistopfExporter
```

## Running Tests

```bash
uv run pytest cimhub_distopf/tests/ -v
```
