Skip to content

refactor: Rename nodes to n in generators and centr_*_tmax() - #2860

Open
krlmlr wants to merge 2 commits into
claude/issue-2788-subagents-faw1t1from
claude/issue-2788-subagents-faw1t1-2
Open

krlmlr wants to merge 2 commits into
claude/issue-2788-subagents-faw1t1from
claude/issue-2788-subagents-faw1t1-2

Conversation

@krlmlr

@krlmlr krlmlr commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2788 (PR 2 of the stack, on top of #2859); executes the nodes → n row of the survey — the direction #692 recorded as essentially uncontested (62 functions already use n).

What this does

Renames the vertex-count argument nodes to n in 16 functions:

  • Game generators (11): sample_grg/grg, sample_pref/pref, sample_asym_pref/asym_pref, sample_traits/traits, sample_traits_callaway/traits_callaway, sample_forestfire.
  • Centralization (4): centr_betw_tmax, centr_clo_tmax, centr_degree_tmax, centr_eigen_tmax. The latter two had no registry entry and no ... yet, so they gain their standard 3.0.0 keyword-only migration here (loops stays required-with-no-default in the tail, unfold_tree() style; the existing loops/scale lifecycle guards are preserved).
  • graph_from_graphdb (1): nodes sits after ..., so this is a pure registry rename (bare-symbol nodes = n in old) — legacy nodes = calls are recovered by the generated block under the usual single soft-deprecation.

nodes is a head formal everywhere else, which the recovery machinery cannot rescue from ... — so those functions follow the as_adjacency_matrix() attr/weights precedent: positional calls bind n unchanged (no warning), and a surviving trailing nodes = deprecated() sentinel catches by-name legacy calls with a soft-deprecation and a conflict error when both spellings are supplied. Dot-case wrapper functions (grg.game() etc.) keep their frozen signatures and forward n = nodes.

Selector-nodes functions (ego() family, constraint(), alpha_centrality(), power_centrality()) are deliberately untouched — they rename to vertices in a later PR of this stack.

Notes for review

  • Abbreviated legacy spellings (node =, nod =) of the retired head name now fail loudly with the "spell out the full argument name" guidance instead of partial-matching — same trade-off the attr → weights rename shipped.
  • tests/testthat/_snaps/foreign.md was updated by hand for the renamed error text because graph_from_graphdb() needs network access unavailable in the development sandbox; the offline-renderable messages were verified to match exactly.

The #2788 stack

Each PR is based on the previous one and merges in this order:

  1. refactor: Rename algo to algorithm in page_rank(), feedback_arc_set() and feedback_vertex_set() #2859: algo → algorithm
  2. refactor: Rename nodes to n in generators and centr_*_tmax() #2860: nodes → n (vertex counts) ← this PR
  3. refactor: snake_case weights arguments in clique functions and cluster_infomap() #2861: weights arguments
  4. refactor: Rename normalization flags to normalized #2862: normalization flags → normalized
  5. refactor: Purge legacy alias formals via the migration registry #2863: hand-rolled alias formals into the registry
  6. refactor: Rename vertex-selector arguments to vertices and vertex #2864: selectors → vertices/vertex
  7. refactor: Rename edge-selector arguments to edges #2943: edge selectors → edges
  8. refactor: Rename index to vertices/edges in the attribute accessors #2944: attribute accessors: index → vertices/edges
  9. refactor: Rename iteration arguments to n_iter/max_iter #2945: iterations → n_iter/max_iter
  10. refactor: snake_case the dotted arguments of the graph generators and degree-sequence functions #2946: snake_case: generators and degree sequences
  11. refactor: snake_case the dotted arguments of the layout functions #2947: snake_case: layouts
  12. refactor: snake_case the dotted arguments of the community, HRG, motif and graphlet functions #2948: snake_case: community, HRG, motifs, graphlets (Mu → mu)
  13. refactor: snake_case the dotted arguments of the structural and conversion functions #2950: snake_case: structural and conversion functions
  14. refactor: Rename algorithm-selection arguments to algorithm and measure selection to measure #2951: algorithm family → algorithm/measure (closes Algorithm-selection argument names: census of method/algorithm/algo/impl/implementation #2932)

🤖 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 b391ca2 is merged into claude/issue-2788-subagents-faw1t1:

  • ✔️as_adjacency_matrix: 759ms -> 762ms [-0.23%, +1.08%]
  • ✔️as_biadjacency_matrix: 765ms -> 765ms [-0.67%, +0.83%]
  • ✔️as_data_frame_both: 1.68ms -> 1.66ms [-3.9%, +1%]
  • ✔️as_long_data_frame: 4.06ms -> 4.08ms [-1.18%, +2.32%]
  • ✔️es_attr_filter: 2.76ms -> 2.73ms [-3.02%, +0.89%]
  • ✔️graph_from_adjacency_matrix: 123ms -> 124ms [-0.7%, +2.48%]
  • ✔️graph_from_data_frame: 3.71ms -> 3.74ms [-0.44%, +1.98%]
  • ✔️vs_attr_filter: 1.57ms -> 1.55ms [-2.55%, +0.98%]
  • ✔️vs_by_name: 1.02ms -> 1.03ms [-2.52%, +3.82%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@krlmlr
krlmlr force-pushed the claude/issue-2788-subagents-faw1t1-2 branch from b391ca2 to 3ad95b8 Compare September 3, 2026 09:57
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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

  • ✔️as_adjacency_matrix: 788ms -> 789ms [-0.59%, +0.95%]
  • ✔️as_biadjacency_matrix: 777ms -> 775ms [-0.91%, +0.44%]
  • ✔️as_data_frame_both: 1.71ms -> 1.71ms [-1.92%, +1.78%]
  • ✔️as_long_data_frame: 4.25ms -> 4.24ms [-1.88%, +1.37%]
  • ✔️es_attr_filter: 2.81ms -> 2.85ms [-6.05%, +9.65%]
  • ✔️graph_from_adjacency_matrix: 121ms -> 122ms [-0.88%, +1.93%]
  • ✔️graph_from_data_frame: 3.91ms -> 3.85ms [-3.23%, +0.55%]
  • ✔️vs_attr_filter: 1.59ms -> 1.59ms [-1.64%, +1.99%]
  • ✔️vs_by_name: 1.06ms -> 1.04ms [-6.98%, +3.25%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

…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
@krlmlr
krlmlr force-pushed the claude/issue-2788-subagents-faw1t1-2 branch from 3ad95b8 to 5253256 Compare September 10, 2026 09:03
@github-actions

Copy link
Copy Markdown
Contributor

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

  • ✔️as_adjacency_matrix: 224ms -> 224ms [-0.57%, +1%]
  • ✔️as_biadjacency_matrix: 251ms -> 250ms [-0.88%, +0.38%]
  • ✔️as_data_frame_both: 253ms -> 257ms [-0.18%, +3.22%]
  • ❗🐌as_long_data_frame: 206ms -> 208ms [+0.31%, +1.59%]
  • ✔️es_attr_filter: 242ms -> 241ms [-1.05%, +0.55%]
  • ✔️graph_from_adjacency_matrix: 274ms -> 274ms [-0.93%, +0.68%]
  • ✔️graph_from_data_frame: 273ms -> 272ms [-0.7%, +0.36%]
  • ✔️vs_attr_filter: 293ms -> 295ms [-1.16%, +2.71%]
  • ✔️vs_by_name: 268ms -> 268ms [-2.05%, +2.48%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@github-actions

Copy link
Copy Markdown
Contributor

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

  • ✔️E_named: 204ms -> 203ms [-1.53%, +0.29%]
  • ✔️V_named: 417ms -> 414ms [-2.32%, +0.73%]
  • ✔️all_simple_paths_named: 125ms -> 125ms [-0.84%, +0.79%]
  • ✔️as_adjacency_matrix: 230ms -> 230ms [-1.08%, +0.4%]
  • ✔️as_biadjacency_matrix: 245ms -> 245ms [-0.46%, +0.94%]
  • ✔️as_data_frame_both: 218ms -> 219ms [-0.03%, +0.53%]
  • ✔️as_long_data_frame: 173ms -> 173ms [-0.46%, +0.37%]
  • ✔️ego_order2_named: 137ms -> 138ms [-0.3%, +1.11%]
  • ✔️es_attr_assign: 221ms -> 220ms [-0.59%, 0%]
  • ✔️es_attr_filter: 225ms -> 225ms [-0.34%, +0.35%]
  • ✔️graph_from_adjacency_matrix: 271ms -> 272ms [-0.26%, +0.35%]
  • ✔️graph_from_data_frame: 244ms -> 244ms [-0.7%, +0.48%]
  • ✔️head_of_named: 155ms -> 155ms [-0.53%, +0.21%]
  • ✔️incident_edges: 162ms -> 163ms [0%, +0.85%]
  • ✔️max_cliques_named: 23.1ms -> 23.4ms [-2.02%, +5.2%]
  • ❗🐌neighbors_by_name: 207ms -> 209ms [+0.38%, +1.2%]
  • ✔️union_named: 211ms -> 212ms [-0.24%, +0.49%]
  • ✔️vs_attr_filter: 236ms -> 236ms [-0.32%, +0.62%]
  • ✔️vs_by_name: 196ms -> 196ms [-0.5%, +0.46%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Algorithm-selection argument names: census of method/algorithm/algo/impl/implementation

3 participants