PowerOpenAPIModels
Julia transport types for the Sienna power-system data model, generated from SiennaSchemas.
These packages are the wire format, not the data model. They describe what a Sienna system looks like as JSON — every component, every association row, every unit annotation — with no dependency on PowerSystems.jl or InfrastructureSystems.jl. That is what lets a parser, a database, a service, or a language other than Julia exchange a system with Sienna without linking against Sienna itself.
Every version below 1.0 is a pre-release. These packages can change incompatibly in any release, and no API stability is promised until 1.0. Julia treats a bump in x of 0.x.y as breaking, so a [compat] entry of "0.1" resolves within 0.1.* — pin accordingly.
The seven packages
Seven packages live in one repository, each registered separately so an application loads only what it needs. The dependency chain is acyclic and each package owns one layer.
| Package | Owns | Depends on |
|---|---|---|
InfrastructureCoreOpenAPIModels | Domain-neutral types, the model-type registry, the unit vocabulary, the APIModel supertypes, AbstractDocument and document versioning | — |
InfrastructureTimeSeriesOpenAPIModels | The six time series association types | InfrastructureCore |
PowerCoreOpenAPIModels | Power types shared across domains: topology, curves, costs, enums; SystemDocument | InfrastructureCore, InfrastructureTimeSeries |
PowerOperationsOpenAPIModels | Branches, injections, services, outages, market structures | PowerCore |
PowerInvestmentsOpenAPIModels | Technologies, financial data, policy requirements; PortfolioDocument | PowerCore, InfrastructureTimeSeries |
PowerDynamicsOpenAPIModels | Dynamic machine, exciter, governor, and inverter models | PowerCore |
PowerOpenAPIModels | Re-exports all six | all |
The two Infrastructure* packages must never gain a Power* dependency; the test suites enforce it.
Installation
using Pkg
# Everything, plus the document containers
Pkg.add("PowerOpenAPIModels")
# Or one domain only
Pkg.add("PowerOperationsOpenAPIModels")A first example
using PowerOpenAPIModels, JSON
bus = ACBus(;
id = 1,
number = 1,
name = "bus1",
available = true,
bustype = ACBusType("REF"),
base_voltage = 138.0,
voltage_limits = MinMax(; min = 0.95, max = 1.05),
)
text = JSON.json(encode(bus))"{\"id\":1,\"number\":1,\"name\":\"bus1\",\"available\":true,\"bustype\":\"REF\",\"voltage_limits\":{\"max\":1.05,\"min\":0.95},\"base_voltage\":138.0}"back = decode(ACBus, JSON.parse(text))
back.voltage_limitsMinMax(1.05, 0.95, Dict{String, Any}())The API describes the whole surface: how a generated type is shaped, how encoding and decoding work, how enums and discriminated unions are represented, how units are declared, and how a whole document is assembled and validated.
Schema defaults are not filled in
A schema default documents the value a consumer assumes when a field is absent. No SDK inserts it: this package and the Python, TypeScript and Rust packages behave the same way.
- An omitted optional field decodes to
ABSENT, and encoding leaves it out. Reading and writing a document never adds a value the producer did not write, andABSENTtells a field that was not given from one set to its default value. - A field the schema marks
requiredstays required, even when it has a default (CostCurve.vom_cost, the portfolio financial rates). - A
constfield, such as a discriminator (time_series_type,curve_type,cost_type), is set to its fixed value, whether the schema marks it required or optional.
To use a default, apply it where you read the field. The schema reference lists every default.
Regenerating
The Julia sources under each package's src/ are generated by OpenAPI.jl's native Julia generator from the SiennaSchemas bundles. A fix belongs in the schema or in the generator configuration, never in the generated file — see the repository README.