Repository navigation
Project view edge endpoints with one helper and drop repeated focus checks - #184
Conversation
chapter_view and _scope_view each spelled out every inside and outside combination of an edge's two endpoints, and repeated the boundary projection once per side. Each now projects one endpoint in a local function and applies it to both ends. The skip rules, boundary members and edge counts are unchanged.
_focus_view re-checked the node id and radius that both of its callers validate first. _node_view filtered its selection for duplicates and unknown ids, but both callers pass distinct ids from graph.nodes: full_view passes the mapping itself, and _focus_view passes a sorted set of ids that _adjacency has already looked up.
Review at a52040dVerdict: merge-ready. The no-behaviour-change claim holds line by line, and nothing else turned up. In Landing
|
Cleanup in
graph_views.py. No behaviour change: 1 file, +22/-39, one commit per item.chapter_view,_scope_view). Each view spelled out every inside and outside combination of an edge's two ends, and repeated the boundary projection once per side. Each now projects one end in a localendpointfunction and applies it to both. The skip rules are the same:chapter_viewskips an edge with neither end inside the chapter, and_scope_viewskips an edge whose ends are under the same child or both outside the scope, and an edge with one end outside unlessinclude_externalis set. Boundary members and edge counts are unchanged._focus_view,_node_view)._focus_viewre-checked the node id and radius thatfocus_viewandfocus_viewsvalidate before they call it._node_viewdropped duplicate and unknown ids from its selection, but both callers pass distinct ids fromgraph.nodes:full_viewpasses the mapping itself, and_focus_viewpasses a sorted set of ids that_adjacencyhas already looked up.Noticed, not changed:
full_viewis the only caller that leaves_node_view'sorderedflag off. Passing its ids in topological order would let the flag go, but Scale roadmap inventories and the full DAG explorer #90 rewrites the lines around that call.Overlaps with open PRs:
graph_views.py. It merges with this branch without adding a conflict, and a pyflakes and duplicate-definition check of the merged file finds nothing new.Validation at exact head
a52040da:ruff check autoform_cli servers testsis clean.tests/test_graph_views.py(8),tests/test_graph_scale.py(30),tests/test_graph_view_rendering.py(2),tests/test_hierarchy_render_regressions.py(7),tests/test_render.py(77),tests/test_visualization.py(23),tests/test_dashboard.py(14) andtests/test_skill_examples.py(25) pass.