Repository navigation
Draw evacuation antennas in the reduced overflow graph - #80
Merged
Merged
Conversation
An evacuation antenna is a part of the grid whose net production leaves through a single node of the constrained path (or several, when insensitive). Its report is insignificant, so its edges are gray, and the reduced view (without_gray_edges) dropped it entirely, although it is a lever. expert_op4grid_recommender detects these antennas and stamps in_evacuation_antenna on their nodes and branches. - OverflowGraphRenderer.prepare_for_plot builds the graph actually drawn. The reduced view keeps the flagged gray edges and the antenna nodes. The edges are drawn in ochre (EVACUATION_ANTENNA_COLOR, darkgoldenrod) and keep their report label and arrow like any other edge; the nodes keep their injection colours. It works on a copy: the model's colours are analysis data (Structured_Overload_Distribution_Graph builds its views from them). A drawn antenna edge keeps base_color="gray", and an antenna edge with a significant report keeps its colour. - delete_color_edges gains keep_flags: an edge carrying one of these boolean flags survives. The analysis views never pass it. - The interactive viewer gains an "Evacuation antennas" layer in the Structural Paths section, with its glyph. Tests: flagged edges kept and restyled on a copy, the model left untouched, the plain full view unchanged; keep_flags, including flags that went through DOT; the antenna layer and its section; every semantic layer swatch has a glyph in viewer.js. On a full-France snapshot (contingency MERLAL62SOULL), the reduced view goes from 26 to 33 nodes with the 7 substations and 14 branches of the Vent des Îles offshore park antenna. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
- test_overflow_renderer: plot hands the printer the graph that prepare_for_plot builds, and the layout of exactly the nodes it keeps, in their order, when the reduced view keeps an evacuation antenna. The printer is replaced in plot's own globals, because other tests reload the graphs modules. - docs/ARCHITECTURE.rst: a new semantic layer also needs its swatch glyph in assets/viewer.js, which a test now checks. - Import order in test_overflow_renderer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
Merged
marota
pushed a commit
that referenced
this pull request
Nov 17, 2026
Bump version 0.3.3 -> 0.3.4 (setup.py, docs/conf.py, download_url) and date the 0.3.4 CHANGELOG entry: evacuation antennas in the overflow graph drawing (PR #80). The reduced view keeps them, in ochre with their report; the interactive viewer gets an "Evacuation antennas" layer; delete_color_edges gains keep_flags; plot is tested with a fake printer. Rendering only: the analysis outputs are unchanged. Checked: the CI command passes (460 tests), and `python -m build` builds expertop4grid-0.3.4 (sdist and wheel) with the viewer assets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
marota
pushed a commit
to ainetus/Expert_op4grid_recommender
that referenced
this pull request
Nov 17, 2026
Evacuation antennas were dropped from the reduced overflow graph: their branches are gray and the drawing deletes gray edges. The rendering is done in ExpertOp4Grid (ainetus/ExpertOp4Grid#80). The reduced view keeps the branches flagged in_evacuation_antenna and draws them in ochre with their report and arrow, like any other edge, and the interactive viewer gets an "Evacuation antennas" layer. The drawing works on a copy: alphaDeesp derives the analysis views from the edge colours, and discovery rebuilds them after the drawing, so repainting the analysis graph here would change the recommendations. No code change here: tag_structural_antennas already stamps the flag (its docstring now says who reads it). The plan, the CHANGELOG and the docs index record phase 3. The expertop4grid floor will be bumped with the release that ships it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
marota
pushed a commit
to ainetus/Expert_op4grid_recommender
that referenced
this pull request
Nov 17, 2026
- test_injections: alphadeesp_node_injections gives one prod / load value per flagged substation, read the way alphaDeesp's build_nodes reads them (both observation flavours), sums the units of a substation, keeps a pump-only substation flagged with a negative production, and skips elements it cannot locate. - test_structural_antennas: phase 3 contract with ExpertOp4Grid's renderer. The reduced view keeps the branches tagged in_evacuation_antenna, in the renderer's colour, and prunes a consumption antenna; the analysis graph keeps its colours. Skipped until the installed expertop4grid ships prepare_for_plot (ainetus/ExpertOp4Grid#80); passes against that branch. - Docs: CLAUDE.md (injections helper, renderer contract, key-files rows, test list) and the islanded-pocket doc's _build_topo, which now emits alphaDeesp's compact node shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <amarot91@gmail.com>
marota
pushed a commit
to ainetus/Expert_op4grid_recommender
that referenced
this pull request
Nov 17, 2026
expertop4grid 0.3.4 (ainetus/ExpertOp4Grid#80, release v0.3.4, now on PyPI) ships the renderer that keeps the evacuation antennas in the reduced overflow graph and the viewer's "Evacuation antennas" layer. Phase 3 is therefore done. - pyproject.toml: expertop4grid>=0.3.4 (was >=0.3.3); requirements.txt pins 0.3.4. CLAUDE.md and the README (still saying >=0.2.8) follow. - Plan (phase 3 done), docs index, CHANGELOG (released, plus a Changed entry for the floor). - The drawing contract test now says it needs 0.3.4 and is only skipped on an older, stale install. Checked against the published package (installed in a scratch folder, first on PYTHONPATH): 2119 passed, and the drawing contract test runs and passes. The 5 failures are the known unrelated ones: 4 manoeuvre goldens of local untracked scenarios, and the grid2op reproducibility test, which fails the same way on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Antoine Marot <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.
Problem
An evacuation antenna is a part of the grid whose net production leaves through a single node of the constrained path, or through several when it is insensitive. Its report is insignificant, so its edges are gray. Yet it is a lever: curtailing or redispatching its production relieves the constraint.
The reduced overflow-graph view (
plot(without_gray_edges=True), i.e.DRAW_ONLY_SIGNIFICANT_EDGESdownstream) deletes gray edges and then isolated nodes, so the antenna disappears entirely.Real case: Vendée full-France snapshot, contingency
MERLAL62SOULL, overload onPALLUL41ZGARA. The Vent des Îles offshore park (234 MW, 7 substations, 14 branches) hangs off the constrained path atSOULLP4. The reduced view showed none of it, onlySOULLP4.expert_op4grid_recommenderalready detects these antennas and stampsin_evacuation_antennaon their nodes and branches (its "structural antennas" detection).Change
OverflowGraphRenderer.prepare_for_plotbuilds the graph actually drawn;plotuses it.in_evacuation_antenna, and therefore the antenna nodes.EVACUATION_ANTENNA_COLOR = "darkgoldenrod".Structured_Overload_Distribution_Graphbuilds its blue / red views by deleting colours, and downstream discovery rebuilds those views after the drawing. Repainting the model would change the constrained path, loops and hubs.base_color="gray", soedge_role_ofstill reads it as insignificant.delete_color_edges(..., keep_flags=()). An edge carrying one of the given boolean flags survives;is_flag_setalso accepts the"True"strings produced by DOT. The analysis views never pass it, so their behaviour is unchanged.in_evacuation_antenna, nodes and edges) in the Structural Paths section, with an ochre glyph. It lets the operator show the antenna alone or hide it.docs/ARCHITECTURE.rst(semantic flags, renderer, and the glyph a new semantic layer needs) and the model docstring.Tests
test_overflow_renderer.py::TestEvacuationAntennas:TestPlotDrawsThePreparedGraph:plothands the printer the prepared graph, and the layout of exactly the nodes it keeps, in their order.test_graph_utils.py:keep_flagsspares flagged edges and their nodes, including flags that went through DOT.test_interactive_html.py:viewer.js.pytest --ignore=alphaDeesp/tests/pypownet/ --ignore=alphaDeesp/tests/test_cli.py --ignore=alphaDeesp/tests/test_expert_rules.py): 460 passed.expert_op4grid_recommenderon the snapshot above:Impact
Rendering only: no analysis output changes. Callers that never stamp
in_evacuation_antennaget exactly the previous drawing.expert_op4grid_recommenderwill raise itsexpertop4gridfloor once this is released.🤖 Generated with Claude Code