Skip to content

Colour the THT preview backbone by real kV + harden network loader - #194

Merged
marota merged 1 commit into
ainetus:mainfrom
marota:claude/expert-op4grid-performance-t1pdrq
Jul 22, 2026
Merged

Colour the THT preview backbone by real kV + harden network loader#194
marota merged 1 commit into
ainetus:mainfrom
marota:claude/expert-op4grid-performance-t1pdrq

Conversation

@marota

@marota marota commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

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.

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>
@marota
marota merged commit a037cd5 into ainetus:main Jul 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant