Expand description
C ABI for powerio: ABI v5.
Functions parse, query, and convert networks through opaque handles. Feature
gates add Arrow tables, directory datasets, distribution networks,
.pio.json packages, and SCOPF problem instances. Each entry point is
extern "C" and writes errors to a caller provided buffer.
The C API follows a fixed grammar, written out in the header preamble
(include/powerio.h, generated by cbindgen, never hand-edit):
- Verb-led names are operations and the verb fixes the return family:
parse/read/normalizereturn a new handle,writehas a filesystem effect,converttranscodes without keeping a handle,freedestroys. to_marks a representation change of the same network; the target is a format string (pio_to_format) unless the output type differs (pio_to_arrowfills Arrow C Data Interface structs).- Format names never appear in symbols: formats are strings, so a new
format never changes this ABI. Model JSON uses
pio_to_jsonandpio_from_json. - Array extractors share the cap/count convention: write up to
capvalues, return the total available,NULLout is a pure count query. - Vocabulary: a bus is a named connection point (this API is bus granular); a node is one conductor’s point at a bus, reserved for the multiconductor API; a branch is any two-terminal series element, lines and transformers alike.
Structs§
- PioDist
Network - Opaque parsed distribution network handle (the multiconductor wire coordinate
model). Distinct from
PioNetwork(the positive sequence transmission model); none of thepio_n_*/extractor functions accept it. Only built with thedistcargo feature. - PioNetwork
- Opaque parsed network handle. Carries the parsed
BalancedNetwork, theIndexCorederived from it once at parse time (so every indexed query reuses the same bus-id map and per-bus aggregates instead of rebuilding them), and the reader’s fidelity warnings (pio_warnings). - PioPackage
- Opaque
.pio.jsoncompiler package handle. A package owns onepowerio_pkg::NetworkPackage, which wraps either a balancedPioNetworkpayload or a multiconductorPioDistNetworkpayload. - PioScopf
Instance - Opaque matrix free SCOPF instance.
Constants§
- PIO_
ABI_ VERSION - ABI version of this C interface. Bump on any breaking change to an existing
pio_*signature or documented behavior, including removing a supported format token from the C API. New additive symbols do not require a bump. A consumer comparespio_abi_versionagainst the value it was built against (thePIO_ABI_VERSIONmacro inpowerio.h) and refuses a mismatched library before calling another function. - PIO_
ARROW_ TABLE_ BDOUBLEPRIME - PIO_
ARROW_ TABLE_ BPRIME - PIO_
ARROW_ TABLE_ BRANCH - PIO_
ARROW_ TABLE_ BUS - Table selectors for
pio_to_arrow; the C header mirrors these asPIO_ARROW_TABLE_*. - PIO_
ARROW_ TABLE_ GEN - PIO_
ARROW_ TABLE_ INCIDENCE - PIO_
ARROW_ TABLE_ LOAD - PIO_
ARROW_ TABLE_ MATRIX_ BRANCH - PIO_
ARROW_ TABLE_ MATRIX_ BUS - PIO_
ARROW_ TABLE_ SHUNT - PIO_
ARROW_ TABLE_ SOLVER_ ARC - PIO_
ARROW_ TABLE_ SOLVER_ BRANCH - PIO_
ARROW_ TABLE_ SOLVER_ BUS - PIO_
ARROW_ TABLE_ SOLVER_ GEN - PIO_
ARROW_ TABLE_ SOLVER_ HVDC - PIO_
ARROW_ TABLE_ SOLVER_ LOAD - PIO_
ARROW_ TABLE_ SOLVER_ SHUNT - PIO_
ARROW_ TABLE_ SOLVER_ STORAGE - PIO_
ARROW_ TABLE_ SOLVER_ SWITCH - PIO_
ARROW_ TABLE_ SWITCH - PIO_
ARROW_ TABLE_ YBUS - PIO_
DIST_ ABI_ VERSION - Frozen at 1 and no longer meaningful. It existed to absorb distribution volatility, but that volatility lives in the BMOPF schema, which changes a reader, a writer and an emitted token, and no C signature. One shared object carrying two compatibility promises is a thing no mature C library does.
- PIO_
ERRBUF_ MIN - Recommended error buffer size: pass a
char[PIO_ERRBUF_MIN]to anyerrbuf/warnbufparameter and a message always fits without truncation.
Functions§
- pio_
abi_ version - The ABI version the library was built with (see
PIO_ABI_VERSION). Lets a consumer detect a stale or incompatible library at load time. Infallible. - pio_
arrow_ ⚠catalog_ json - Return the Arrow table catalog as owned compact JSON.
- pio_
base_ ⚠mva - pio_
branch_ ⚠charging - Write the branch terminal charging table as parallel arrays, each up to
capentries, and return the total branch count. Columns are p.u. - pio_
branches ⚠ - Write the branch table as parallel arrays, each up to
capentries, and return the total branch count. A branch is any two-terminal series element lines and transformers alike (a transformer hastap != 0).from/toare 1-based bus IDS (thepio_bus_idsid space, not dense indices); map them to dense matrix rows with thepio_bus_idsordering. Any output pointer may be NULL to skip that column; all NULL is the count query. - pio_
build_ info - Everything a loader needs to decide what this library can do, as one owned
JSON document. Free the returned string with
pio_string_free. Infallible. - pio_
bus_ ⚠demand - Write the per-bus demand aggregates (active
pd, reactiveqd, summed over each bus’s loads, densepio_bus_idsorder), each up tocapentries, and return the total bus count. Either pointer may be NULL. - pio_
bus_ ⚠ids - Write the 1-based external bus ids, in dense order, into
out, up tocapentries, and return the total bus count. This ordering DEFINES the dense index space every other per-bus array shares. Call once with(NULL, 0)to size, allocate, then call again to fill. Ids are int64 in1..2^63-1(a v4 invariant); a source id that is a string or exceeds that range is mapped to dense int64 at read, never passed through raw. - pio_
bus_ ⚠shunt - Write the per-bus shunt aggregates (conductance
gs, susceptancebs, densepio_bus_idsorder), each up tocapentries, and return the total bus count. Either pointer may be NULL. - pio_
classify_ ⚠str - Classify in-memory JSON case
textby its top level markers, without parsing the case. Writes one of - pio_
convert_ ⚠file - Convert the case file at
pathfrom formatfrom(NULL to infer from the path, aspio_parse_file) to formatto, without keeping a handle. Returns the converted text as an owned C string (free withpio_string_free),NULLon error. Fidelity warnings, read side first, are published throughout_warningsas one owned C string (free it withpio_string_free), NULL when there are none. Pass NULL to discard them. - pio_
convert_ ⚠str - Convert in-memory case
textfrom formatfrom(required; there is no path to infer from) to formattowithout keeping a handle. Returns the converted text as an owned C string (free withpio_string_free),NULLon error. Fidelity warnings, read side first, are written\n-joined intowarnbuf. - pio_
dist_ abi_ version - The ABI version of the optional
pio_dist_*C API. Only linked when thedistfeature is compiled in; probe that first withpio_has_feature("dist")if loading dynamically. - pio_
dist_ capabilities_ json - Return distribution capability flags as owned JSON. Free the returned string
with
pio_string_free. Only linked when thedistfeature is compiled in; runtime loaders can either checkpio_has_feature("dist")or probe for this symbol directly. The JSON schema is versioned separately fromPIO_DIST_ABI_VERSIONso new additive flags do not force a C signature change. - pio_
dist_ ⚠convert_ file - Convert distribution case
pathfrom optional source formatfromto formatto; seepio_dist_parse_filefor the inference rules. Returns the converted text as an owned C string (free withpio_string_free),NULLon error. The warnings written\n-joined intowarnbufcarry both the parse warnings and the writer’s fidelity losses (there is no handle to query them). - pio_
dist_ ⚠convert_ str - Convert in-memory distribution case
textof formatfromto formatto(both required;dss,pmd, orbmopf). The parameter order is input, source, target, matchingpio_dist_convert_file. Returns the converted text as an owned C string (free withpio_string_free),NULLon error. The warnings written\n-joined intowarnbufcarry both the parse warnings and the writer’s fidelity losses (there is no handle to query them). - pio_
dist_ ⚠from_ json - Parse model JSON produced by
pio_dist_to_json(or lifted from a.pio.jsondocument’smodel.multiconductor_network) back into an owned handle: the inverse ofpio_dist_to_json. The rebuilt handle retains no source text, so a same format write is a fresh serialization. The handle retains the model JSONwarnings. ReturnsNULLon error. Free withpio_dist_network_free. - pio_
dist_ ⚠geo_ apply - Apply a geographic sidecar (any form
pio_geo_parseaccepts) onto a NEW distribution network handle; the input handle is unchanged and both are freed withpio_dist_network_free.name_hint(a file name, nullable) picks CSV against JSON as inpio_geo_parse. The returned handle drops the retained source text, so a same-format write re-serializes the placed case. The reader’s notes and an apply summary are appended to the handle’s warnings (pio_dist_warnings). ReturnsNULLon error. - pio_
dist_ ⚠geo_ extract - Extract a multiconductor network’s coordinates as the canonical GeoJSON
layer, keyed by the string bus and line names. Free the returned string
with
pio_string_free. ReturnsNULL(with a message) when the network carries no coordinates. - pio_
dist_ ⚠graph_ json - Serialize the collapsed bus and terminal graph projection for
netas JSON. The returned string is owned by the library; free it withpio_string_free. - pio_
dist_ ⚠network_ free - Free a distribution network handle from
pio_dist_parse_fileorpio_dist_parse_str. NULL is a no-op; free exactly once. - pio_
dist_ ⚠parse_ file - Parse a distribution case file into a
PioDistNetworkhandle. The format comes fromfromif non-NULL (dss,pmd, orbmopf), else from the file itself:.dssis OpenDSS, and.jsonholding the ENGINEERINGdata_modelkey is PMD JSON, otherwise BMOPF JSON. ReturnsNULLon error and writes the message intoerrbuf. Free the handle withpio_dist_network_free. - pio_
dist_ ⚠parse_ str - Parse in-memory distribution case
textof the namedformat(dss,pmd, orbmopf; required, since there is no path to infer from). An OpenDSSRedirect/Compileintextresolves against the current working directory. ReturnsNULLon error and writes the message intoerrbuf. Free the handle withpio_dist_network_free. - pio_
dist_ ⚠summary_ json - Serialize a compact summary of a distribution handle as JSON. This lets
bindings answer display and scalar queries without forcing
pio_dist_to_json’s full model payload. - pio_
dist_ ⚠to_ format - Serialize
netto distribution formatto(dss,pmd, orbmopf). Writing back to the format the handle was parsed from echoes the source text byte for byte; a cross format write reports every fidelity loss inwarnbuf(\n-joined). Returns the text as an owned C string (free withpio_string_free),NULLon error. - pio_
dist_ ⚠to_ json - Serialize
netto its model JSON: the same object a.pio.jsonpackage carries undermodel.multiconductor_network, without the surrounding document. This is the bindings’ data transport, not a case format: the converter, CLI, and format inference do not know it; distribution cases exchanged with other tools are BMOPF JSON (pio_dist_to_format). Returns an owned C string (free withpio_string_free),NULLon error. - pio_
dist_ ⚠warnings - Parse warnings retained on the handle (everything the reader could not
represent or had to assume),
\n-joined and written into the callerwarnbuf(truncated to fit, always NUL-terminated). Returns the total byte length of the joined message; call withNULL/0 to size first, then fill — the same idiom aspio_warnings. Returns 0 for a NULL handle. - pio_
from_ ⚠json - Parse model JSON produced by
pio_to_json(or lifted from a.pio.jsondocument’smodel.balanced_network) back into an owned handle, the inverse ofpio_to_jsonand the function form of parsing under thepowerio-jsontoken. ReturnsNULLon error. Free withpio_network_free. - pio_
gens ⚠ - Write the generator table as parallel arrays, each up to
capentries, and return the total generator count.busis the 1-based bus id (thepio_bus_idsid space). Any output pointer may be NULL to skip. - pio_
geo_ ⚠apply - Apply a geographic sidecar (any form
pio_geo_parseaccepts) onto a NEW network handle; the input handle is unchanged and both are freed withpio_network_free.name_hint(a file name, nullable) picks CSV against JSON as inpio_geo_parse. Matched bus points land inBus.location, matched branch routes inBranch.route. The returned handle drops the retained source text, so a same-format write re-serializes the placed case instead of echoing the original. The reader’s notes and an apply summary (geo apply: N bus point(s), ...) are appended to the handle’s warnings (pio_warnings). ReturnsNULLon error. - pio_
geo_ ⚠extract - Extract a network’s coordinates as the canonical GeoJSON layer: one point
per located bus, one route per routed branch. Free the returned string
with
pio_string_free. ReturnsNULL(with a message) when the network carries no coordinates. - pio_
geo_ ⚠parse - Normalize a tolerant geographic sidecar (headerless buscoords CSV, aliased
CSV/JSON records, GeoJSON Point/LineString) to the canonical GeoJSON form.
name_hint(a file name, nullable) picks CSV against JSON when given; otherwise the content is sniffed. The tolerant reader’s notes are not returned here; parse through the Rust or Python surface to see them. Free the returned string withpio_string_free. ReturnsNULLon input that carries no usable coordinates and writes the message intoerrbuf. - pio_
has_ ⚠feature - Whether an optional build feature is compiled in: pass
"arrow","matrix","gridfm","dist","pkg", or"prob". Returns 1 if present, 0 otherwise (and 0 for a NULL or unknown name). The optional entry points (pio_to_arrow, the matrix Arrow tables, thepio_read_dir/gridfm path, thepio_dist_*block, and thepio_package_*block) are only linked when their feature is built, so a consumer that loaded the library at runtime probes for them here instead of resolving symbols blind. Feature names are strings like format names, so a new feature never changes this signature. Infallible. - pio_
is_ ⚠radial 1if the in-service topology is radial (every island a tree), else0.- pio_
matrix_ available - Whether the matrix Arrow table API is usable in this build. Returns 1
only when both
arrowandmatrixare compiled in. Matrix tables usepio_to_arrow. Infallible. - pio_
n_ ⚠branches - pio_
n_ ⚠buses - pio_
n_ ⚠gens - pio_
n_ ⚠islands - Number of islands: connected components of the in-service topology.
- pio_
n_ ⚠switches - pio_
network_ ⚠free - Free a network handle from
pio_parse_file,pio_parse_str,pio_read_dir,pio_normalize, orpio_normalize_with_options. - pio_
network_ ⚠name - Case name. Writes UTF-8 bytes into
out, up tocap, NUL-terminates when possible, and returns the byte length needed excluding the NUL.NULLorcap == 0is a size query. - pio_
normalize ⚠ - Normalize
netinto a NEW network handle: per unit, radians, out of service filtered, source bus ids preserved, bus types canonicalized (seeBalancedNetwork::to_normalized). A value transform, not a serialization, hence the verb, while theto_*family re-encodes unchanged data. The result is independent ofnet; free both withpio_network_free. Every extractor and serializer works on it unchanged (the handle is per unit, not MW). ReturnsNULLon error (no reference bus can be chosen, or a non-positive base MVA) and writes the message intoerrbuf. - pio_
normalize_ ⚠with_ options - Normalize
netinto a NEW network handle, with opt in solver preparation repairs.clamp_angle_bounds != 0applies the same branch angle difference bound repair as PowerModels (angmin <= -pi/2,angmax >= pi/2, and zero/zero bounds replaced by[-angle_bound_pad, angle_bound_pad]). A repair that would invert the interval widens to that same window. The default pad is 1.0472 radians. Existing read warnings and repair warnings are attached to the returned handle and can be read withpio_warnings. - pio_
package_ ⚠diagnostics_ json - Return the package structured diagnostics array as JSON. The returned string
is owned by the library; free it with
pio_string_free. - pio_
package_ ⚠free - Free a package handle returned by
pio_package_*. NULL is a no-op; free exactly once. - pio_
package_ ⚠from_ balanced_ network - Wrap a balanced
PioNetworkhandle in a.pio.jsonpackage. The C handle name is historical; the payload ispowerio::BalancedNetwork.include_solver_metadata != 0attaches compact normalized solver table metadata. - pio_
package_ ⚠from_ multiconductor_ network - Wrap a multiconductor
PioDistNetworkhandle in a.pio.jsonpackage. The C handle name is historical; the payload ispowerio_dist::MulticonductorNetwork. - pio_
package_ ⚠lower_ multiconductor_ to_ balanced - Lower a multiconductor package to a new balanced package. Call
pio_package_multiconductor_to_balanced_preflight_jsonfirst when the caller needs structured blockers for unsupported inputs.base_mvais the three phase system power base used for the balanced per-unit projection. - pio_
package_ ⚠materialize_ operating_ point - Materialize one operating point into a new static package.
- pio_
package_ ⚠materialize_ study_ commit - Materialize one study commit into a new static package.
- pio_
package_ ⚠multiconductor_ to_ balanced_ preflight_ json - Return the multiconductor-to-balanced lowering preflight report as JSON.
base_mvais the three phase system power base used for the balanced per-unit projection. ReturnsNULLif the package is not multiconductor. - pio_
package_ ⚠operating_ points_ json - Return the package operating point series as JSON, or
nullwhen absent. The returned string is owned by the library; free it withpio_string_free. - pio_
package_ ⚠parse_ file - Parse a
.pio.jsonpackage file into an opaque package handle. This reads only the package; case format names still enter throughpio_parse_file/pio_dist_parse_fileand package constructors. ReturnsNULLon error and writes the message intoerrbuf. Free the handle withpio_package_free. - pio_
package_ ⚠parse_ str - Parse in-memory
.pio.jsontext into an opaque package handle. ReturnsNULLon error and writes the message intoerrbuf. Free the handle withpio_package_free. - pio_
package_ ⚠set_ operating_ points - Replace the package’s operating point series from
json.nullor an empty series clears it. Validation is recomputed before this function returns. Returns0on success and-1on error. - pio_
package_ ⚠study_ json - Return the package study block as JSON, or
nullwhen absent. The returned string is owned by the library; free it withpio_string_free. - pio_
package_ ⚠to_ balanced_ network - Materialize the balanced payload of a package handle as an owned network
handle: the inverse of
pio_package_from_balanced_network. Errors when the package holds a different model kind. The handle is built from the payload alone: it retains no source text, so a same format write is a fresh serialization rather than a byte-exact echo, and it carries no parse warnings. Free withpio_network_free. - pio_
package_ ⚠to_ json - Serialize a package handle to compact
.pio.json. Returns an owned C string (free withpio_string_free) orNULLon error. - pio_
package_ ⚠to_ multiconductor_ network - Materialize the multiconductor payload of a package handle as an owned
distribution network handle: the inverse of
pio_package_from_multiconductor_network. Errors when the package holds a different model kind. The handle retains no source text, so a same format write is a fresh serialization. The handle retains the payload’s parse warnings, readable throughpio_dist_warnings. Free withpio_dist_network_free. - pio_
package_ ⚠validate - Run the package semantic validation profile in place. Returns
0on success,-1on error. - pio_
package_ ⚠validation_ json - Return the package validation summary as JSON. The returned string is owned
by the library; free it with
pio_string_free. - pio_
parse_ ⚠bytes - Parse
lenbytes of in-memory case data of the namedformatinto a network handle. Accepts everypio_parse_strformat name pluspwb: PowerWorld binary has no text form, so before this call the only way to reach that reader waspio_parse_file, which means staging a temporary file.bytesneed not be NUL-terminated and may contain interior NULs; text formats are decoded as UTF-8 and fail with a message if they are not. - pio_
parse_ ⚠file - Parse
path(format from extension, orfromif non-NULL) into a network handle.fromaccepts thepio_parse_strformat names pluspypsa-csv/pypsa,goc3-json/goc3,surge-json/surge, andpwb; that includespslf/epc, and.epcis inferred by extension. A PyPSA CSV folder is a directory, so it can only enter through this function, withfrom = "pypsa-csv"(or NULL when the directory holds anetwork.csv). Read fidelity warnings attach to the handle (pio_warnings). ReturnsNULLon error and writes the message intoerrbuf. Free the handle withpio_network_free. - pio_
parse_ ⚠str - Parse in-memory case
textof the namedformatinto a network handle. Unlikepio_parse_filethere is no path to infer from, soformatis required: one ofmatpower/m,powermodels/pm,egret,pandapower-json/pandapower/pp,psse/raw,powerworld/aux,pslf/epc,goc3-json/goc3, orsurge-json/surge. PyPSA CSV folders are directories, not text; parse them withpio_parse_fileandfrom = "pypsa-csv". Read fidelity warnings attach to the handle (pio_warnings). ReturnsNULLon error and writes the message intoerrbuf. Free the handle withpio_network_free. Also acceptspowerio-json/jsonas aliases forpio_from_json. - pio_
read_ ⚠dir - Read one scenario of a dataset directory in the named
fromformat into a network handle.gridfm(the gridfm-datakit Parquet layout;dirresolves leniently: theraw/leaf, a<case>/directory with araw/child, or a parent holding exactly one such case) is the currently supported dataset format.scenarioselects within a multi-scenario dataset (pio_scenario_idsenumerates them); formats without scenarios take0. Read fidelity warnings attach to the handle (pio_warnings). ReturnsNULLon error and writes the message intoerrbuf. Free the handle withpio_network_free. Built--features gridfm. - pio_
ref_ ⚠bus_ index - Dense
[0, n)index of the single reference (slack) bus, or-1if not exactly one. An INDEX into thepio_bus_idsordering, not a bus id;pio_branchesfrom/to carry ids, so the unit is in the name. A network may carry several references (one per island, or a normalized case that kept the file’s multipleREFbuses);pio_ref_bus_indicesreads them all, and its count (NULLout) tells zero from many. - pio_
ref_ ⚠bus_ indices - Write the dense
[0, n)indices of the reference (slack) buses, ascending, intoout, up tocapentries, and return the total count: the cap/count convention ofpio_bus_ids.0means none;> 1means one reference per island or several fixed references in one island (a normalized case always reports>= 1). - pio_
scenario_ ⚠ids - Write the distinct scenario ids (ascending) of the dataset directory
dirin the namedfromformat intoout, up tocapentries, and return the total count: the cap/count convention ofpio_bus_ids.gridfmis the currently supported dataset format. Returns-1on error and writes the message intoerrbuf(unlike the handle extractors, this reads the filesystem and can fail). Built--features gridfm. - pio_
schema_ versions_ json - Report the schema version of each document format in this library, as
owned JSON. Free the returned string with
pio_string_free. Infallible. - pio_
scopf_ ⚠instance_ free - Free a SCOPF instance handle.
NULLis a no-op; free each handle once. - pio_
scopf_ ⚠parse_ str - Parse SCOPF source text into an owned problem instance.
fromcurrently accepts"goc3-json". ReturnsNULLon error and writes the message intoerrbuf. Free the handle withpio_scopf_instance_free. - pio_
scopf_ ⚠to_ json - Serialize a SCOPF instance as its Julia compatibility document. The JSON records
its schema version and index base. Free the returned string with
pio_string_free. ReturnsNULLfor a null handle or serialization error. - pio_
source_ ⚠format - Source format enum spelling used by the JSON snapshot, for example
Matpower,PowerModelsJson, orNormalized. Uses the same cap/count string convention aspio_network_name. - pio_
string_ ⚠free - Free any owned C string returned by this API.
- pio_
summary_ ⚠json - Serialize a compact balanced network summary as JSON for display and scalar
queries without serializing
pio_to_json’s full payload. - pio_
switches ⚠ - Write the switch table as parallel arrays, each up to
capentries, and return the total switch count.from/toare external bus ids. - pio_
to_ ⚠arrow - Export one network table over the Arrow C Data Interface: the
to_conversion whose output type is Arrow structs rather than a string, and the bulk table surface of this ABI. Tables 0..5 are raw network tables; tables 6..14 are normalized solver tables with per unit/radian values and dense zero based row ids; the matrix tables carry COO triplets in that dense index space with dimensions in schema metadata. New columns extend the Arrow schema without changing an existing C signature. - pio_
to_ ⚠format - Serialize
netto the named formatto: the one text serializer; every format is named by a string. Accepts thepio_parse_strnames:matpoweris a byte-exact echo when the handle was parsed from MATPOWER. Also acceptspowerio-jsonas an alias forpio_to_json. Model JSON cannot represent a non-finitef64(Inf/NaN): it writesnull, records the field inout_warnings, and fails validation when read back. - pio_
to_ ⚠json - Serialize
netto its model JSON: the same object a.pio.jsonpackage carries undermodel.balanced_network, without the surrounding document, and the same text thepowerio-jsonformat token writes. This is the bindings’ data transport; the token remains as a compatibility alias for file based workflows. Returns an owned C string (free withpio_string_free),NULLon error. - pio_
version - The crate version string (a semver string),
'staticand NUL-terminated. Do NOT free it. Informational; pair it withpio_abi_versionfor the actual compatibility check. - pio_
warnings ⚠ - The fidelity warnings attached to the handle at construction (by whichever
of
pio_parse_file,pio_parse_str,pio_read_dir, orpio_normalizebuilt it),\n-joined intowarnbuf(truncated to fit on a UTF-8 boundary; NULL/0 to skip). Returns the byte length of the full joined text, excluding the NUL; call once with(NULL, 0)to size, then pass achar[len + 1].0means no warnings (or a NULL handle); readers that are total attach none. - pio_
write_ ⚠dir - Write
netintoout_diras the named directory formatto. PyPSA CSV (pypsa-csv/pypsa) is the currently supported directory format; a text format name is an error pointing back atpio_to_format. Returns0on success and-1on error (message intoerrbuf). Fidelity warnings, if any, are published throughout_warningsas one owned C string (free it withpio_string_free), NULL when there are none. Pass NULL to discard them.