Colour the THT preview backbone by real kV + harden network loader - #194
Merged
marota merged 1 commit intoJul 22, 2026
Merged
Conversation
Two fixes for the France THT preview + loader: - gen_network_previews: read each voltage level's nominal kV from the network's <voltageLevel nominalV=...> instead of parsing the substation id. RTE ids (e.g. 1ARGIP7) carry no 3-digit kV, so the id regex put the whole map on one colour — the 400 kV backbone never showed red. Now 307 HV levels render red. Widen the two colours' separation for red-green colour-blind viewers (warm vermillion vs a darker, bluer teal — a gap on luminance + the blue channel, not only the red-green axis) and draw the HV backbone thicker + opaque as a redundant, colour-independent cue. - network_service: make _resolve_network_file self-healing so a study loads no matter what the deploy left on disk — decode a .gz.b64 passed directly, decode from a directory that holds only a .gz.b64, and re-decode when a present network.xiidm is not valid XML (a truncated decode or an un-smudged Git-LFS pointer) but a sibling .gz.b64 exists. Previously such a file reached pypowsybl and raised 'Unsupported file format'. Adds tests for each path. Signed-off-by: marota <amarot91@gmail.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.
Two fixes for the France THT preview + loader:
gen_network_previews: read each voltage level's nominal kV from the network's instead of parsing the substation id. RTE ids (e.g. 1ARGIP7) carry no 3-digit kV, so the id regex put the whole map on one colour — the 400 kV backbone never showed red. Now 307 HV levels render red. Widen the two colours' separation for red-green colour-blind viewers (warm vermillion vs a darker, bluer teal — a gap on luminance + the blue channel, not only the red-green axis) and draw the HV backbone thicker + opaque as a redundant, colour-independent cue.
network_service: make _resolve_network_file self-healing so a study loads no matter what the deploy left on disk — decode a .gz.b64 passed directly, decode from a directory that holds only a .gz.b64, and re-decode when a present network.xiidm is not valid XML (a truncated decode or an un-smudged Git-LFS pointer) but a sibling .gz.b64 exists. Previously such a file reached pypowsybl and raised 'Unsupported file format'. Adds tests for each path.