pynenc.invocation.status_graph¶
Render the invocation status state machine from the status configuration.
Key components:
Layout search: ranks statuses from live transitions and chooses compact rows.
Straight-edge clipping: attaches arrow endpoints to node boundaries.
SVG renderer: draws styled nodes, transitions, and legend from status metadata.
Module Contents¶
Classes¶
Functions¶
Return the SVG representation generated from the current status config. |
|
Return a plain-text representation of the invocation status graph. |
|
Compute and validate the compact graph layout. |
|
Rank nodes by shortest transition distance from START. |
|
Refine shortest-path ranks using ownership semantics from the graph. |
|
Group statuses into ranked columns. |
|
Return evenly spaced y lanes for the densest computed column. |
|
Return x coordinate per status rank. |
|
Return deterministic row targets after neighbor relaxation sweeps. |
|
Return row seeds from semantic, inverted, and centered preferences. |
|
Return row targets from connected statuses plus semantic bias. |
|
Return the best unique lane assignment for one column. |
|
Place semantic outliers before the global crossing score takes over. |
|
Build node positions from computed row assignments. |
|
Validate computed layout before rendering. |
|
Return node bounds. |
|
Return whether padded bounds overlap. |
|
Return the first non-endpoint node crossed by an edge. |
|
Return whether a line crosses rectangle bounds. |
|
Return whether a point lies inside bounds. |
|
Return whether two line segments intersect. |
|
Return point orientation relative to a line. |
|
Return whether point lies on a segment. |
|
Return every rendered transition edge. |
|
Return the best straight boundary-to-boundary edge. |
|
Return boundary anchors for a node, ordered toward the other node. |
|
Score whether an anchor faces the other endpoint. |
|
Score a valid anchor line by direction, length, and straightness. |
|
Clip START edge to its circular boundary. |
|
Return the length of a line. |
|
Data¶
API¶
- pynenc.invocation.status_graph.DEFAULT_OUTPUT_PATH: Final[pathlib.Path]¶
None
- pynenc.invocation.status_graph.NodeKey¶
None
- pynenc.invocation.status_graph.ANCHOR_FRACTIONS: Final[tuple[float, ...]]¶
(0.0, 0.25, 0.5, 0.75, 1.0)
- class pynenc.invocation.status_graph.Line[source]¶
Straight edge segment after clipping to source and target nodes.
- pynenc.invocation.status_graph.render_svg() str[source]¶
Return the SVG representation generated from the current status config.
- pynenc.invocation.status_graph.render_text() str[source]¶
Return a plain-text representation of the invocation status graph.
- pynenc.invocation.status_graph._layout() pynenc.invocation.status_graph.Layout[source]¶
Compute and validate the compact graph layout.
- pynenc.invocation.status_graph._rank_nodes(edges: list[tuple[pynenc.invocation.status_graph.NodeKey, pynenc.invocation.status.InvocationStatus]]) dict[pynenc.invocation.status_graph.NodeKey, int][source]¶
Rank nodes by shortest transition distance from START.
- pynenc.invocation.status_graph._refine_ranks(ranks: dict[pynenc.invocation.status_graph.NodeKey, int], edges: list[tuple[pynenc.invocation.status_graph.NodeKey, pynenc.invocation.status.InvocationStatus]]) dict[pynenc.invocation.status_graph.NodeKey, int][source]¶
Refine shortest-path ranks using ownership semantics from the graph.
- pynenc.invocation.status_graph._columns_by_rank(ranks: dict[pynenc.invocation.status_graph.NodeKey, int]) dict[int, tuple[pynenc.invocation.status.InvocationStatus, ...]][source]¶
Group statuses into ranked columns.
- pynenc.invocation.status_graph._lane_positions(max_column_size: int) tuple[int, ...][source]¶
Return evenly spaced y lanes for the densest computed column.
- pynenc.invocation.status_graph._x_positions(max_rank: int) dict[int, float][source]¶
Return x coordinate per status rank.
- pynenc.invocation.status_graph._relaxed_row_sets(columns: dict[int, tuple[pynenc.invocation.status.InvocationStatus, ...]], lanes: tuple[int, ...], edges: list[tuple[pynenc.invocation.status_graph.NodeKey, pynenc.invocation.status.InvocationStatus]]) list[dict[pynenc.invocation.status.InvocationStatus, int]][source]¶
Return deterministic row targets after neighbor relaxation sweeps.
- pynenc.invocation.status_graph._seed_rows(columns: dict[int, tuple[pynenc.invocation.status.InvocationStatus, ...]], lanes: tuple[int, ...]) list[dict[pynenc.invocation.status.InvocationStatus, int]][source]¶
Return row seeds from semantic, inverted, and centered preferences.
- pynenc.invocation.status_graph._neighbor_targets(column: tuple[pynenc.invocation.status.InvocationStatus, ...], rows: dict[pynenc.invocation.status.InvocationStatus, int], edges: list[tuple[pynenc.invocation.status_graph.NodeKey, pynenc.invocation.status.InvocationStatus]]) dict[pynenc.invocation.status.InvocationStatus, float][source]¶
Return row targets from connected statuses plus semantic bias.
- pynenc.invocation.status_graph._best_column_rows(column: tuple[pynenc.invocation.status.InvocationStatus, ...], lanes: tuple[int, ...], targets: collections.abc.Mapping[pynenc.invocation.status.InvocationStatus, float]) dict[pynenc.invocation.status.InvocationStatus, int][source]¶
Return the best unique lane assignment for one column.
- pynenc.invocation.status_graph._preferred_lane(status: pynenc.invocation.status.InvocationStatus) int[source]¶
Place semantic outliers before the global crossing score takes over.
- pynenc.invocation.status_graph._positions_from_rows(rows: dict[pynenc.invocation.status.InvocationStatus, int], x_positions: dict[int, float], ranks: dict[pynenc.invocation.status_graph.NodeKey, int]) dict[pynenc.invocation.status_graph.NodeKey, tuple[float, float]][source]¶
Build node positions from computed row assignments.
- pynenc.invocation.status_graph._validate_layout(layout: pynenc.invocation.status_graph.Layout) None[source]¶
Validate computed layout before rendering.
- pynenc.invocation.status_graph._node_bounds(positions: dict[pynenc.invocation.status_graph.NodeKey, tuple[float, float]], node: pynenc.invocation.status_graph.NodeKey) tuple[float, float, float, float][source]¶
Return node bounds.
- pynenc.invocation.status_graph._bounds_overlap(first: tuple[float, float, float, float], second: tuple[float, float, float, float], padding: int) bool[source]¶
Return whether padded bounds overlap.
- pynenc.invocation.status_graph._edge_crosses_non_endpoint_node(positions: dict[pynenc.invocation.status_graph.NodeKey, tuple[float, float]], source: pynenc.invocation.status_graph.NodeKey, target: pynenc.invocation.status.InvocationStatus, line: pynenc.invocation.status_graph.Line) pynenc.invocation.status_graph.NodeKey | None[source]¶
Return the first non-endpoint node crossed by an edge.
- pynenc.invocation.status_graph._segment_intersects_bounds(line: pynenc.invocation.status_graph.Line, bounds: tuple[float, float, float, float]) bool[source]¶
Return whether a line crosses rectangle bounds.
- pynenc.invocation.status_graph._point_inside_bounds(point_x: float, point_y: float, bounds: tuple[float, float, float, float]) bool[source]¶
Return whether a point lies inside bounds.
- pynenc.invocation.status_graph._segments_intersect(first: pynenc.invocation.status_graph.Line, second: pynenc.invocation.status_graph.Line) bool[source]¶
Return whether two line segments intersect.
- pynenc.invocation.status_graph._orientation(line: pynenc.invocation.status_graph.Line, point_x: float, point_y: float) int[source]¶
Return point orientation relative to a line.
- pynenc.invocation.status_graph._point_on_segment(line: pynenc.invocation.status_graph.Line, point_x: float, point_y: float) bool[source]¶
Return whether point lies on a segment.
- pynenc.invocation.status_graph._iter_edges() list[tuple[pynenc.invocation.status_graph.NodeKey, pynenc.invocation.status.InvocationStatus]][source]¶
Return every rendered transition edge.
- pynenc.invocation.status_graph._svg_header(layout: pynenc.invocation.status_graph.Layout) str[source]¶
- pynenc.invocation.status_graph._render_edge(layout: pynenc.invocation.status_graph.Layout, source: pynenc.invocation.status_graph.NodeKey, target: pynenc.invocation.status.InvocationStatus) str[source]¶
- pynenc.invocation.status_graph._edge_line(positions: dict[pynenc.invocation.status_graph.NodeKey, tuple[float, float]], source: pynenc.invocation.status_graph.NodeKey, target: pynenc.invocation.status.InvocationStatus) pynenc.invocation.status_graph.Line[source]¶
Return the best straight boundary-to-boundary edge.
- pynenc.invocation.status_graph._anchor_candidates(positions: dict[pynenc.invocation.status_graph.NodeKey, tuple[float, float]], node: pynenc.invocation.status_graph.NodeKey, other: pynenc.invocation.status_graph.NodeKey) tuple[tuple[float, float], ...][source]¶
Return boundary anchors for a node, ordered toward the other node.
- pynenc.invocation.status_graph._anchor_direction_penalty(anchor: tuple[float, float], center: tuple[float, float], other: tuple[float, float]) float[source]¶
Score whether an anchor faces the other endpoint.
- pynenc.invocation.status_graph._anchor_line_score(positions: dict[pynenc.invocation.status_graph.NodeKey, tuple[float, float]], source: pynenc.invocation.status_graph.NodeKey, target: pynenc.invocation.status.InvocationStatus, line: pynenc.invocation.status_graph.Line) tuple[float, ...][source]¶
Score a valid anchor line by direction, length, and straightness.
- pynenc.invocation.status_graph._clip_circle_endpoint(center: tuple[float, float], target: tuple[float, float]) tuple[float, float][source]¶
Clip START edge to its circular boundary.
- pynenc.invocation.status_graph._line_length(line: pynenc.invocation.status_graph.Line) float[source]¶
Return the length of a line.
- pynenc.invocation.status_graph._render_node(layout: pynenc.invocation.status_graph.Layout, node: pynenc.invocation.status_graph.NodeKey) str[source]¶
- pynenc.invocation.status_graph._style_for(status: pynenc.invocation.status.InvocationStatus, definition: pynenc.invocation.status.StatusDefinition) str[source]¶
- pynenc.invocation.status_graph._badge_for(definition: pynenc.invocation.status.StatusDefinition) str[source]¶
- pynenc.invocation.status_graph._render_legend(layout: pynenc.invocation.status_graph.Layout) str[source]¶