Conversation
Two readers took coordinates[0] as the latitude, so every freshly exported twin transposed every bus: a rebuilt Trois-Rivieres base carried lat in [-72.62, -72.59] and lon in [46.33, 46.35], and the dashboard catalog then centred the map at lat -13.133 / lon -13.133, where nothing is. GeoJSON Point coordinates are [longitude, latitude] (RFC 7946), which is what pandapower writes into net.bus['geo'] from the builder's x=longitude / y=latitude node attributes. The committed base from 2026-08-12, same adapter, has the columns the right way round, so this is a regression against the repo's own artifact. Nothing under tests/ referenced either helper, which is why it shipped: both fields are floats, and a swap only shows up as a map centred in the South Atlantic. GeoJsonCoordinateOrderTest now pins what pandapower writes, both readers, and a Quebec-range bound a transposition cannot satisfy. Measured failing-first: re-introducing the defect fails 3 of its 4 tests. bd 06l Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
bd syntgrid-06l. Two readers parsed a bus's GeoJSON
geovalue as[latitude, longitude], so every freshly exported twin transposed every bus.GeoJSON Point coordinates are
[longitude, latitude](RFC 7946), and that is what pandapower writes intonet.bus["geo"]from the builder'sx= longitude /y= latitude node attributes (PandapowerGridBuilder.create_bus_geodata, andgridalyn/twin/core/graph.pydocuments the convention).gridalyn/twin/adapters/network.py:_coords_from_geo— the base export.gridalyn/projects/workflows/scripts/run_digital_twin_ev_powerflow.py:_coords_from_geo— the per-scenario node artifacts the dashboard draws.How it was found, and why nothing caught it
Rebuilding the Trois-Rivières twin to look at it in the dashboard:
gridalyn twin basewrotegrid_buses.parquetwithlatin [-72.6204, -72.5878] andlonin [46.3315, 46.3544]. The dashboard catalog then reportedextent.bbox[-72.62, -72.62, 46.35, 46.35]and centre{lat: -13.133, lon: -13.133}, andviewState.jsframes the map from that centre — so the map could not show the network at all.The committed
instances/default/digital_twin/base/grid_buses.parquet(2026-08-12, sameadapter_id) has the columns the right way round, so this is a regression against the repo's own artifact, not the original behaviour. It stayed invisible because the committed base predates the pandapowergeocolumn, both fields are floats, and nothing undertests/referenced either helper.Verification
tests/test_network_adapters.py::GeoJsonCoordinateOrderTest, four tests: what pandapower actually writes (the premise, independent of our readers), the exported bus table, a Québec-range bound that a transposition cannot satisfy whatever the columns are named, and the second reader.Not in this PR
Artifacts already written with the columns transposed are not migrated: outside this repo nothing tracked carries them, and the committed base predates the defect. The issue records that decision.
🤖 Generated with Claude Code