Skip to content

ExpertOp4Grid v0.3.2 — Semantic overflow-graph layers

Choose a tag to compare

@marota marota released this 05 May 08:35
· 10 commits to master since this release

Highlights

This release elevates the interactive overflow-graph viewer from
colour / shape heuristics to semantic, source-of-truth layer
toggles
. The recommender now propagates explicit boolean flags on
graph nodes and edges, and the viewer surfaces them through three
labelled checkbox sections with a dim-instead-of-hide model.

  • Semantic node / edge tagsis_hub, in_red_loop,
    on_constrained_path on nodes; is_overload, is_monitored,
    in_red_loop, on_constrained_path on edges. is_overload is a
    strict subset of is_monitored (every overloaded contingency line
    is also a low-margin line).
  • New public taggers on OverflowGraph
    tag_red_loops(lines, nodes) and
    tag_constrained_path(lines, nodes) consume the recommender's
    pre-computed lists. set_hubs_shape now also marks hubs with
    in_red_loop AND on_constrained_path so they always appear
    under those layers.
  • highlight_significant_line_loading reworked — now tags every
    monitored line with is_monitored=True and the strict
    contingency-overloaded subset with is_overload=True.
  • Grouped layer sidebar in the interactive viewer — three
    labelled sections (Structural Paths / Individual entities
    properties / Flow redispatch values) ordered via
    _LAYER_SECTIONS and _SECTION_ORDER.
  • Membership-based dim model — opacity drops to 0.12 for
    unchecked elements; no display:none, so click / hover stay
    live. An element is visible iff at least one of its claiming
    layers is currently checked.
  • Endpoint-node inclusion — edge-only layers also dim /
    highlight the bbox-endpoint nodes of their claimed edges, so
    toggling "Overloads" alone keeps the substations the overload
    connects visible (no floating edges in dimmed space).
  • Select-all / Unselect-all link row above the layer list,
    dispatching the same change event individual checkboxes do.
  • _align_edge_ids_with_svg() regression guard — graphviz's
    SVG and JSON edge orderings drift independently; we now re-key
    the JSON edge model from the SVG <title> endpoints so
    data-source / data-target always match the title content.

What's Changed

PR #75 — Add semantic source-of-truth tagging + grouped layer toggles

  • OverflowGraph.set_hubs_shape adds is_hub=True (plus
    in_red_loop and on_constrained_path) on every hub.
  • New OverflowGraph.tag_red_loops(lines, nodes) and
    OverflowGraph.tag_constrained_path(lines, nodes) helpers.
  • OverflowGraph.highlight_significant_line_loading reworked to
    tag is_monitoredis_overload semantics.
  • interactive_html._build_layer_index scans data-attr-* on
    both nodes and edges and emits five new semantic layers.
  • Layers are grouped into three sections via _LAYER_SECTIONS
    rendered in _SECTION_ORDER with section-header markers.
  • Membership-based dim model + endpoint-node inclusion + Select-
    all / Unselect-all controls.
  • _align_edge_ids_with_svg() regression guard for graphviz
    SVG-vs-JSON edge-id misalignment.
  • Comprehensive coverage in tests/test_overflow_graph.py and
    tests/test_interactive_html.py.

Companion releases

  • expert_op4grid_recommender v0.2.1
    wires the constrained-path / red-loop / overloads lists into the
    new taggers.
  • The Co-Study4Grid v0.7+ overflow-analysis tab embeds the
    resulting interactive HTML viewer with an action-pin overlay.

Compatibility

Backwards compatible. Existing callers see no behaviour change —
the new tags are additive, and the new public taggers are no-ops
when not invoked. Any existing serialised overflow graphs continue
to render correctly with the upgraded viewer.

🤖 Generated with Claude Code