Skip to content

refactor: Rename algorithm-selection arguments to algorithm and measure selection to measure - #2951

Merged
schochastics merged 37 commits into
claude/issue-2788-subagents-faw1t1-13from
claude/issue-2788-subagents-faw1t1-14
Dec 3, 2026
Merged

schochastics merged 37 commits into
claude/issue-2788-subagents-faw1t1-13from
claude/issue-2788-subagents-faw1t1-14

Conversation

@schochastics

@schochastics schochastics commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #2932. Part of #2788 (PR 14 of the stack, on top of #2950).

This implements the two-word proposal from #2932 (#2932 (comment)): algorithm for how something is computed, measure for what is computed.

What this does

→ algorithm:

  • method in the isomorphism family: isomorphic(), subgraph_isomorphic(), count_isomorphisms(), count_subgraph_isomorphisms(), isomorphisms(), subgraph_isomorphisms() (the aliases is_isomorphic_to() and is_subgraph_isomorphic_to() follow)
  • method in sample_tree(), sample_degseq(), realize_degseq(), realize_bipartite_degseq(), merge_coords()
  • impl in induced_subgraph()
  • implementation in cluster_spinglass() and fit_power_law()
  • heuristic in greedy_vertex_coloring()

→ measure:

  • method in compare() (generic and its communities/membership/default methods) and similarity()

Unchanged by design: layout_with_fr(grid) (an acceleration switch) and make_clusters(algorithm) (a free-text label read back by algorithm()). With this PR, no live exported function has a method argument any more.

How

  • Registry renames for tail arguments (sample_tree(), sample_degseq(), realize_degseq(), merge_coords(), induced_subgraph(), cluster_spinglass(), greedy_vertex_coloring(), similarity()): legacy names are recovered under the standard single soft-deprecation.
  • Head arguments in the isomorphism functions and fit_power_law(), plus realize_bipartite_degseq() and compare(): positional calls are unchanged and silent, and the old name stays as a trailing method/implementation = deprecated() formal. fit_power_law() has a registry entry, so the generated block handles its rename (see refactor: Rename algo to algorithm in page_rank(), feedback_arc_set() and feedback_vertex_set() #2859). The isomorphism functions, realize_bipartite_degseq() and compare() have none and use a hand-written bridge. For compare() the formal and bridge live in the S3 methods, which must share the generic's formals, because a value reassigned in the generic does not reach the method.
  • The isomorphism functions still forward ... to the per-algorithm backends. An abbreviated meth = used to partial-match the head formal and now lands in ....
  • Internal live callers use the new names (component_wise() → merge_coords()). The sample_degseq() messages for retired values ("simple", …) now say algorithm = . Deprecated wrappers (graph.isomorphic(), similarity.jaccard(), degree.sequence.game(), …) are untouched; only their "please use similarity() with …" hints now name measure.

Tests

There are expect_legacy_arg() checks for every renamed function, including the spec twins tree()/degseq(), a positional call, and the conflict error when both spellings are supplied.

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)
  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. this PR: algorithm family → algorithm/measure (Algorithm-selection argument names: census of method/algorithm/algo/impl/implementation #2932)

🤖 Generated with Claude Code

…sure selection to `measure`

`method` (isomorphism functions, `sample_tree()`, `sample_degseq()`,
`realize_degseq()`, `realize_bipartite_degseq()`, `merge_coords()`),
`impl` (`induced_subgraph()`), `implementation` (`cluster_spinglass()`,
`fit_power_law()`) and `heuristic` (`greedy_vertex_coloring()`) become `algorithm`;
`method` in `compare()` and `similarity()` becomes `measure`.
Legacy names are recovered with a soft-deprecation.

Closes #2932. Part of #2788.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

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

  • ✔️E_named: 124ms -> 124ms [-1.9%, +1.16%]
  • ✔️V_named: 265ms -> 261ms [-4.03%, +0.9%]
  • ✔️all_simple_paths_named: 93.7ms -> 93.1ms [-1.8%, +0.56%]
  • ✔️as_adjacency_matrix: 127ms -> 127ms [-1.24%, +0.26%]
  • ✔️as_biadjacency_matrix: 142ms -> 143ms [-0.9%, +2.02%]
  • ✔️as_data_frame_both: 150ms -> 149ms [-4.52%, +2.85%]
  • ✔️as_long_data_frame: 123ms -> 119ms [-8.77%, +1.73%]
  • ✔️ego_order2_named: 109ms -> 109ms [-1.71%, +1.47%]
  • ✔️es_attr_assign: 135ms -> 139ms [-1.94%, +7%]
  • ✔️es_attr_filter: 139ms -> 139ms [-1.44%, +0.56%]
  • ✔️graph_from_adjacency_matrix: 165ms -> 162ms [-4.38%, +1.28%]
  • ✔️graph_from_data_frame: 162ms -> 160ms [-6.18%, +3.44%]
  • ✔️head_of_named: 109ms -> 111ms [-1.6%, +5.76%]
  • ✔️incident_edges: 121ms -> 120ms [-2.01%, +1.71%]
  • ✔️max_cliques_named: 18.1ms -> 18ms [-2.31%, +1.26%]
  • ✔️neighbors_by_name: 157ms -> 154ms [-5.82%, +2.28%]
  • ✔️union_named: 146ms -> 145ms [-1.11%, +0.74%]
  • ✔️vs_attr_filter: 172ms -> 175ms [-0.95%, +4.8%]
  • ✔️vs_by_name: 147ms -> 148ms [-0.14%, +1.69%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@krlmlr
krlmlr added this pull request to stack #2872 October 18, 2026 09:34
krlmlr and others added 8 commits October 18, 2026 09:44
…e-2788-subagents-faw1t1-14

# Conflicts:
#	man/cluster_spinglass.Rd
#	man/degree.sequence.game.Rd
#	man/fit_power_law.Rd
#	man/realize_bipartite_degseq.Rd
#	man/realize_degseq.Rd
#	man/sample_degseq.Rd
#	man/spinglass.community.Rd
…e-2788-subagents-faw1t1-14

# Conflicts:
#	R/coloring.R
#	R/community.R
#	R/games.R
#	R/layout.R
#	R/make.R
#	R/similarity.R
#	R/structural-properties.R
#	tests/testthat/_snaps/topology.md
#	tests/testthat/test-community.R
#	tests/testthat/test-games.R
#	tests/testthat/test-layout.R
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

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

Status Name Current Incoming Interval
✔️ V_named 366.2ms 364ms [-2.06%, +0.82%]
✔️ graph_from_adjacency_matrix 221.1ms 221.5ms [-0.51%, +0.93%]
✔️ graph_from_data_frame 209.9ms 211.5ms [-0.19%, +1.8%]
✔️ vs_subset_positional 194.5ms 194.6ms [-1.05%, +1.2%]
✔️ as_biadjacency_matrix 180ms 182.3ms [-0.9%, +3.54%]
✔️ as_adjacency_matrix 172.3ms 173.5ms [-0.02%, +1.46%]
✔️ es_attr_filter 172.4ms 173.2ms [-0.13%, +0.95%]
✔️ es_attr_assign 170.1ms 170.6ms [-0.19%, +0.85%]
✔️ E_named 166.4ms 166.3ms [-0.84%, +0.71%]
✔️ vs_by_name 157.2ms 157.4ms [-0.39%, +0.61%]
❗🐌 as_data_frame_both 152.8ms 154.7ms [+0.12%, +2.4%]
✔️ max_cliques_sizes_named 153.6ms 153.9ms [-0.56%, +0.88%]
✔️ as_long_data_frame 142.6ms 142.1ms [-1.14%, +0.36%]
✔️ union_named 133.8ms 134.4ms [-0.11%, +1.06%]
✔️ vs_attr_filter 130.1ms 130.5ms [-1%, +1.71%]
✔️ incident_edges 122.9ms 123.4ms [-0.34%, +1.15%]
✔️ ego_order2_named 116.9ms 116.6ms [-1.08%, +0.53%]
✔️ head_of_named 115.6ms 116.2ms [-0.42%, +1.5%]
✔️ neighbors_by_name 99.5ms 99.8ms [-0.17%, +0.89%]
✔️ all_simple_paths_named 97.4ms 97.4ms [-0.66%, +0.81%]
✔️ vs_by_literal_name 73ms 72.8ms [-0.92%, +0.29%]
✔️ degree_few_vertices 65.3ms 65.4ms [-0.7%, +1.1%]
🚀 strength_weighted_named 23.1ms 22.9ms [-1.6%, -0.22%]
✔️ max_cliques_named 19.5ms 19.5ms [-0.38%, +0.75%]

Further explanation regarding interpretation and methodology can be found in the documentation.

Last updated for commit ff6dfb8.

schochastics and others added 4 commits December 2, 2026 21:20
…e-2788-subagents-faw1t1-14

# Conflicts:
#	R/fit.R
#	tests/testthat/test-games.R
#	tests/testthat/test-similarity.R
#	tests/testthat/test-structural-properties.R
#	tests/testthat/test-topology.R
@schochastics schochastics reopened this Dec 3, 2026
@schochastics schochastics reopened this Dec 3, 2026
schochastics and others added 10 commits December 3, 2026 09:57
…e-2788-subagents-faw1t1-14

# Conflicts:
#	tests/testthat/_snaps/structural-properties.md
…e-2788-subagents-faw1t1-14

# Conflicts:
#	tests/testthat/_snaps/structural-properties.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-2788-subagents-faw1t1-14

# Conflicts:
#	R/fit.R
#	R/games.R
… values follow

`fit_power_law(implementation = )` joins the registry entry, so the generator
re-matches calls that use any of its old names against the old signature and
the hand-written bridges are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schochastics schochastics reopened this Dec 3, 2026
github-actions Bot and others added 5 commits December 3, 2026 16:49
…t1-13' into HEAD

# Conflicts:
#	revdep/README.md
#	revdep/cran.md
#	revdep/failures.md
#	revdep/manifest.json
#	revdep/problems.md
#	revdep/problems/glyrepr.md
#	revdep/problems/manynet.md
#	revdep/problems/nat.md
#	revdep/problems/netrics.md
#	revdep/problems/tidygraph.md
@schochastics
schochastics merged commit 004a6ba into main Dec 3, 2026
12 checks passed
@schochastics
schochastics deleted the claude/issue-2788-subagents-faw1t1-14 branch December 3, 2026 20:01
schochastics added a commit to schochastics/rigraph that referenced this pull request Dec 4, 2026
…sure selection to `measure` (igraph#2951)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
Co-authored-by: schochastics <schochastics@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 004a6ba)
schochastics added a commit to schochastics/rigraph that referenced this pull request Dec 4, 2026
…sure selection to `measure` (igraph#2951)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
Co-authored-by: schochastics <schochastics@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
(cherry picked from commit 004a6ba)
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

2 participants