Format Conversion with Arrow Intermediate
gat convert format lets you bridge MATPOWER, PSS/E, CIM, pandapower, and PowerModels.jl case files by writing a temporary Arrow dataset and then running the appropriate exporter. The CLI auto-detects the source when you omit --from, and the Arrow intermediate keeps downstream tooling stable even when you move between formats.
Supported Formats
GAT supports bidirectional conversion between six power system data formats:
| Format | Extension | Description | Best For |
|---|---|---|---|
| Arrow | .arrow/ | Native GAT directory format | Analytics, DuckDB, GAT solvers |
| MATPOWER | .m | MATLAB power system format | Academic research |
| PSS/E | .raw | Siemens PSS/E RAW format | Utility planning |
| CIM | .rdf | IEC 61970 CIM RDF/XML | SCADA interchange |
| pandapower | .json | Python pandapower format | Python integration |
| PowerModels.jl | .json | Julia PowerModels format | Julia optimization |
Usage
When --from is omitted the command auto-detects the input format; provide it explicitly when an extension is ambiguous (e.g., .json could be pandapower or PowerModels.jl). --force overwrites existing directories or files.
Target Formats
--to arrow: keep the temporary Arrow dataset for DuckDB, Polars, or downstream GAT solvers.--to matpower: export a.mfile with bus/gen/branch/gencost data for MATPOWER tools.--to psse: emit a PSS/E RAW file with bus, load, generator, and branch sections.--to cim: write a minimal CIM RDF/XML graph for round-tripping through the CIM importer.--to pandapower: serialize bus, load, gen, line, and trafo tables into pandapower JSON.--to powermodels: export PowerModels.jl JSON format for Julia optimization tools.
Examples
Basic Conversion
# MATPOWER to Arrow
# Arrow to MATPOWER
# PSS/E to pandapower
PowerModels.jl Workflows
# Export to PowerModels.jl for Julia optimization
# Import from PowerModels.jl
# Convert PGLib benchmarks to MATPOWER
Industrial Format Interchange
# CIM to Arrow for analysis
# Arrow to CIM for SCADA systems
Data Preservation
Each exporter reloads the Arrow dataset (load_grid_from_arrow) before writing the final target, ensuring conversions stay deterministic even when chained.
Preserved Fields
- Bus: ID, name, voltage (kV, p.u.), vmin/vmax limits, area/zone
- Generator: Bus, P/Q output, min/max limits, cost model
- Load: Bus, active/reactive power demand
- Branch: From/to bus, R/X, charging B, tap ratio, ratings, status
- Cost models: Polynomial (
c0 + c1*P + c2*P^2) and piecewise linear
Cost Model Handling
Generator cost models are preserved across all formats:
- Polynomial: Coefficient arrays (GAT stores
[c0, c1, c2]) - Piecewise linear: (MW, cost) breakpoint pairs
Note: PowerModels.jl uses reversed coefficient order [c2, c1, c0]. GAT handles this automatically.
Format-Specific Notes
PowerModels.jl
- Dictionary-based JSON with
baseMVAat root level - Component indices as string keys:
"bus": {"1": {...}, "2": {...}} - Compatible with PGLib-OPF benchmarks
- Auto-detected by checking for
baseMVA+buswithout pandapower markers
pandapower vs PowerModels.jl
Both use .json extension. GAT disambiguates by content:
- pandapower: Contains
pandapowerNetor_modulekeys - PowerModels.jl: Contains
baseMVAat root without pandapower markers
Use --from pandapower or --from powermodels to force the parser.
Metadata
Export metadata from the Arrow manifest (source file, timestamp, and GAT version) is written into the MATPOWER, PSS/E, CIM, pandapower, and PowerModels outputs for provenance tracking.
See Also
- Arrow Schema - Table-by-table Arrow dataset documentation
- pandapower Schema - Column mappings for pandapower
- OPF Guide - Running optimal power flow after conversion