Skip to content

refactor: Rename vertex-selector arguments to vertices - #2864

Open
krlmlr wants to merge 6 commits into
claude/issue-2788-subagents-faw1t1-5from
claude/issue-2788-subagents-faw1t1-6
Open

refactor: Rename vertex-selector arguments to vertices#2864
krlmlr wants to merge 6 commits into
claude/issue-2788-subagents-faw1t1-5from
claude/issue-2788-subagents-faw1t1-6

Conversation

@krlmlr

@krlmlr krlmlr commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Part of #2788 (PR 6 of the stack, on top of #2863); executes the selector decision along the #692 scheme — the survey's most recent point of near-consensus (szhorvat/ntamas/maelle/krlmlr in #692 and #853, maelle again in the #2788 thread): vertices for a subset, n for a count (PR 2 of this stack), v for a single vertex.

What this does

Renames the vertex-subset selector to vertices in 24 functions (+3 aliases that follow automatically):

  • Head selectors, registry + sentinel (positional calls unchanged and silent; named legacy calls soft-deprecated via a surviving trailing deprecated() sentinel): betweenness, closeness, strength, harmonic_centrality, power_centrality, alpha_centrality (was v/vids/nodes); degree, distances (to untouched), constraint, ego, ego_size, make_ego_graph, induced_subgraph, knn; adjacent_vertices, incident_edges; local_efficiency, similarity.
  • Tail selectors, pure registry rename: diversity, page_rank, transitivity.
  • Functions without registry entries (sentinel + bridge, no ... inserted): cocitation, bibcoupling, delete_vertices, isomorphism_class, count_triangles, max_degree.

Single-vertex arguments deliberately keep their names per #692: neighbors(v), incident(v), subcomponent(v), cluster_spinglass(vertex).

Abbreviation guards regenerate accordingly: v/vi/vid on the vids functions and vverte on head cases become explicit ambiguity/spell-out errors where they could mean either spelling; a bare v = on former-vids functions now silently partial-matches vertices (same meaning it always had).

Full test suite: 9357 passing; the only failures are the two environment-bound ones (network for graph_from_graphdb, callr needing an installed igraph).

Deliberately left for follow-up

  • eccentricity(vids = V(graph)) — hand-rolled dots handling and a non-constant default the generator rejects; needs its real migration first.
  • subgraph() — docs promise subgraph_from_edges() takes over this name in the next major; renaming its vids now would churn twice. (Shared Rd note: its still-live vids formal shows the deprecated-badge text from induced_subgraph's page.)
  • graph.isoclass.subgraph() (undocumented legacy alias), shape_noplot() (its v is part of the documented vertex-shape API contract).
  • The edge mirror (eids/es/e) — explicitly an open question in Comprehensive plan: argument renames for 3.0.0 #2788 (edges is taken by 14 constructors, though no function carries both, so edges is mechanically feasible).
  • index in the 11 attribute accessors — spans vertex and edge subsets, so it cannot follow this rename without a per-type split.
  • distances(vertices = , to = ) vs the from/to family — the naming tension flagged in Comprehensive plan: argument renames for 3.0.0 #2788 remains a separate decision.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RTPj4qNv2FWui6etixZeuR


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if 7954b20 is merged into claude/issue-2788-subagents-faw1t1-5:

  • ✔️as_adjacency_matrix: 775ms -> 778ms [-1.1%, +2.03%]
  • ✔️as_biadjacency_matrix: 780ms -> 773ms [-2.39%, +0.75%]
  • ✔️as_data_frame_both: 1.63ms -> 1.63ms [-1.48%, +2.41%]
  • ✔️as_long_data_frame: 4ms -> 4.01ms [-0.44%, +0.97%]
  • ✔️es_attr_filter: 2.74ms -> 2.76ms [-2%, +3.32%]
  • ✔️graph_from_adjacency_matrix: 128ms -> 127ms [-2.09%, +0.89%]
  • ✔️graph_from_data_frame: 3.68ms -> 3.68ms [-0.72%, +0.9%]
  • ✔️vs_attr_filter: 1.61ms -> 1.52ms [-13.35%, +2.55%]
  • ✔️vs_by_name: 1.03ms -> 1.04ms [-1%, +1.95%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

…c_set()` and `feedback_vertex_set()` (#2788, #526)

The legacy `algo` spelling is recovered by the generated ARG_HANDLE blocks
and soft-deprecated;
abbreviations of both spellings are guarded as ambiguous.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTPj4qNv2FWui6etixZeuR
…2788, #692)

Vertex-count arguments unify on `n`:
11 game generators and their spec twins,
the four `centr_*_tmax()` functions
(`centr_degree_tmax()` and `centr_eigen_tmax()` newly gain
their keyword-only migration on the way),
and `graph_from_graphdb()`.
Head positions keep working positionally;
named `nodes =` callers are soft-deprecated
via surviving sentinel formals or registry recovery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTPj4qNv2FWui6etixZeuR
…er_infomap()` (#2788)

`vertex.weights` -> `vertex_weights`, `min.weight` -> `min_weight`,
`max.weight` -> `max_weight` in the weighted-clique functions,
and `e.weights` -> `weights`, `v.weights` -> `vertex_weights`
in `cluster_infomap()`,
via registry renames with soft-deprecated recovery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTPj4qNv2FWui6etixZeuR
`power_centrality(rescale = )`, `hits_scores(scale = )`
and `tk_coords(norm = )` unify on `normalized`,
matching the nine functions that already use that name.
Legacy spellings are soft-deprecated.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTPj4qNv2FWui6etixZeuR
`layout_with_fr(maxiter = )` folds into the registry
as a rename to `niter`
(the alias was silent before, now it soft-deprecates),
`layout_with_kk(start = )` gains its missing soft-deprecation,
`cluster_leiden()` joins the registry
with `resolution_parameter` recovered as `resolution`,
and the long-dead `neimode`/`father` formals and result aliases
of `bfs()`/`dfs()` are removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTPj4qNv2FWui6etixZeuR
The subset selectors `v`, `vids` and `nodes` unify on `vertices`
across 24 functions,
implementing the #692 scheme:
`vertices` selects a subset,
`n` counts (previous PR),
and single-vertex arguments keep `v`
(`neighbors()`, `incident()`, `subcomponent()`).
Head selectors keep positional calls working
and recover named legacy spellings
via surviving sentinel formals;
tail selectors ride the registry recovery.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RTPj4qNv2FWui6etixZeuR
@krlmlr
krlmlr force-pushed the claude/issue-2788-subagents-faw1t1-6 branch from 7954b20 to c597e14 Compare September 3, 2026 09:57
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.

2 participants