From b88029c4ea2abd767b0bca7ccf73973feae13420 Mon Sep 17 00:00:00 2001 From: samtalki <10187005+samtalki@users.noreply.github.com> Date: Mon, 7 Sep 2026 02:04:04 -0400 Subject: [PATCH 1/4] test: verify 0.11.1 BMOPF and PowerWorld geography in Julia --- CHANGELOG.md | 4 ++++ docs/make.jl | 4 +++- docs/src/networks.md | 17 ++++++++++++++++ test/runtests.jl | 1 + test/test_geography.jl | 44 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 test/test_geography.jl diff --git a/CHANGELOG.md b/CHANGELOG.md index 351adbe..ed664d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.11.1 +- Preserve BMOPF bus coordinates and line paths through typed access, PowerIO IR, + and explicit schema-version output with PowerIO 0.11.1. Read geographic bus + locations from supported New England PWB records without changing C ABI 7. + - `to_powerdata` returns `bus.va` in radians, as its docstring states and as the branch `shift`, `angmin`, and `angmax` fields already did (#138). - `to_powerdata` generator rows carry `model`: 0 without a cost record, diff --git a/docs/make.jl b/docs/make.jl index d263368..d3ab841 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -35,4 +35,6 @@ makedocs(; ], ) -deploydocs(; repo = "github.com/eigenergy/PowerIO.jl.git", devbranch = "main") +if get(ENV, "GITHUB_ACTIONS", "false") == "true" + deploydocs(; repo = "github.com/eigenergy/PowerIO.jl.git", devbranch = "main") +end diff --git a/docs/src/networks.md b/docs/src/networks.md index 7a86f23..607e8ab 100644 --- a/docs/src/networks.md +++ b/docs/src/networks.md @@ -123,3 +123,20 @@ reference_bus_ids to_dense to_graph ``` + +## Geographic data + +`bus.location` provides x/y coordinates, and `net.geo` names their coordinate +space. Balanced branches and multiconductor lines expose optional `route` +points. Geographic x/y means longitude/latitude; drawing x/y retains drawing +units. PowerIO IR preserves these values. + +PowerIO 0.11.1 reads supported PWB bus locations and the BMOPFTools proposed +Point/LineString values. Explicit BMOPF output writes geometry under the +schema-valid `extras.geojson` location. Same-type source emission retains source +bytes; after changes, the typed coordinates determine the output. + +A geographic file or a PWD drawing currently appears as a `PioModule{UnknownValue}` +with `type_name == "powerio.GeoLayer"`. It can still be serialized and emitted +through the ordinary module methods. Typed bus locations and line paths remain +available on the electrical networks. diff --git a/test/runtests.jl b/test/runtests.jl index 0c2eda0..9eb7569 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -21,6 +21,7 @@ fixture(parts...) = joinpath(DATA, parts...) include("test_public_api.jl") # the exported surface include("test_operations.jl") # parse, emit, serialize, deserialize include("test_network.jl") # BalancedNetwork element tables + include("test_geography.jl") include("test_dist.jl") # MulticonductorNetwork element tables include("test_collections.jl") # TimeSeries, ScenarioSet, instances, solutions include("test_updates.jl") # typed updates and apply_updates! diff --git a/test/test_geography.jl b/test/test_geography.jl new file mode 100644 index 0000000..c933501 --- /dev/null +++ b/test/test_geography.jl @@ -0,0 +1,44 @@ +@testset "Geographic data" begin + if !LIBRARY_AVAILABLE + @test_skip "libpowerio_capi unavailable" + else + source = raw"""{ + "meta":{"schema_version":"0.2.0"}, + "bus":{ + "a":{"terminal_names":["1"],"geo":{"type":"Point","coordinates":[-83.7,42.3]}}, + "b":{"terminal_names":["1"],"geo":{"type":"Point","coordinates":[-83.6,42.4]}} + }, + "line":{"ab":{"bus_from":"a","bus_to":"b", + "terminal_map_from":["1"],"terminal_map_to":["1"], + "R_series_1_1":0.1,"X_series_1_1":0.2, + "geo":{"type":"LineString","coordinates":[[-83.7,42.3],[-83.68,42.36],[-83.6,42.4]]}}} + }""" + m = parse(IOBuffer(source); format="bmopf-json", name="geo.bmopf.json") + @test m.value.geo.space == "geographic" + @test m.value.buses[1].location.x == -83.7 + @test length(m.value.lines[1].route) == 3 + @test m.value.lines[1].route[2].y == 42.36 + ir = JSON3.read(serialize(m).text, Dict{String,Any}) + ir["value"]["data"]["buses"][1]["location"]["x"] = -83.72 + edited = deserialize(Vector{UInt8}(JSON3.write(ir))) + for version in ("0.1.0", "0.2.0") + written = emit(edited, "bmopf-json@" * version) + doc = JSON3.read(written.text) + @test !haskey(doc.bus.a, :geo) + @test doc.extras.geojson.type == "FeatureCollection" + again = parse(IOBuffer(written.text); format="bmopf-json", name="edited.bmopf.json") + @test again.value.buses[1].location.x == -83.72 + @test again.value.lines[1].route[2].y == 42.36 + end + dataset = get(ENV, "POWERIO_GEO_DATASET", "") + if !isempty(dataset) + case = parse(dataset) + @test case isa PioModule{BalancedNetwork} + @test length(case.value.buses) == 250 + @test all(bus -> bus.location !== nothing, case.value.buses) + restored = deserialize(Vector{UInt8}(serialize(case).text)) + @test [(b.id, b.location.x, b.location.y) for b in restored.value.buses] == + [(b.id, b.location.x, b.location.y) for b in case.value.buses] + end + end +end From 7ac5d3eccaee7490dc98c71df87ced9aeea3f3d3 Mon Sep 17 00:00:00 2001 From: samtalki <10187005+samtalki@users.noreply.github.com> Date: Mon, 7 Sep 2026 02:07:23 -0400 Subject: [PATCH 2/4] docs: refresh the draft 0.11.1 source digest --- .github/powerio-release.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/powerio-release.toml b/.github/powerio-release.toml index 52f4288..9e89a64 100644 --- a/.github/powerio-release.toml +++ b/.github/powerio-release.toml @@ -4,4 +4,4 @@ schema = 1 state = "draft" julia_version = "0.11.1" powerio_tag = "v0.11.1" -source_digest = "sha256:1067946d318998e061ff033a5e26706d474719d305516b03e69024f029bf299a" +source_digest = "sha256:a1c6b291fe1529e6434d78662d7186038b5bb9972cee4a0425a7a35fbd816c5b" From c6a15cfb0aa129ee27d4f894e1db78822ea45e7f Mon Sep 17 00:00:00 2001 From: samtalki <10187005+samtalki@users.noreply.github.com> Date: Mon, 7 Sep 2026 02:27:42 -0400 Subject: [PATCH 3/4] ci: test the 0.11.1 companion instead of the retired candidate --- .github/powerio-companion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/powerio-companion b/.github/powerio-companion index 76d4f36..435b5c0 100644 --- a/.github/powerio-companion +++ b/.github/powerio-companion @@ -1 +1 @@ -agent/release-0.11 +codex/tellegen-release-fixes From feb52b8b36320d314415775664fcd8de1ea90f1f Mon Sep 17 00:00:00 2001 From: samtalki <10187005+samtalki@users.noreply.github.com> Date: Mon, 7 Sep 2026 02:30:03 -0400 Subject: [PATCH 4/4] docs: refresh the draft digest after the CI dependency correction --- .github/powerio-release.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/powerio-release.toml b/.github/powerio-release.toml index 9e89a64..17462b8 100644 --- a/.github/powerio-release.toml +++ b/.github/powerio-release.toml @@ -4,4 +4,4 @@ schema = 1 state = "draft" julia_version = "0.11.1" powerio_tag = "v0.11.1" -source_digest = "sha256:a1c6b291fe1529e6434d78662d7186038b5bb9972cee4a0425a7a35fbd816c5b" +source_digest = "sha256:881f873e4930e058dbd41b0a2b4103be2850ce52e9b4bdd8fecc1215a524fed4"