Skip to content

refactor: snake_case the dotted arguments of the community, HRG, motif and graphlet functions - #2948

Merged
schochastics merged 33 commits into
claude/issue-2788-subagents-faw1t1-11from
claude/issue-2788-subagents-faw1t1-12
Dec 3, 2026
Merged

schochastics merged 33 commits into
claude/issue-2788-subagents-faw1t1-11from
claude/issue-2788-subagents-faw1t1-12

Conversation

@schochastics

@schochastics schochastics commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2788 (PR 12 of the stack, on top of #2947). It continues the snake_case sweep for R/community.R, R/hrg.R, R/motifs.R and R/glet.R, and settles the Mu question from the thread (no case-sensitive argument names, so Mu → mu).

What this does

  • cluster_spinglass(): start.temp, stop.temp, cool.fact, update.rule, gamma.minus → snake_case
  • cluster_fluid_communities(): no.of.communities → n_communities
  • cluster_edge_betweenness(): edge.betweenness → edge_betweenness
  • cluster_infomap(): nb.trials → n_trials
  • consensus_tree(), predict_edges(): num.samples → n_samples, num.bins → n_bins
  • motifs(), count_motifs(), sample_motifs(): cut.prob → cut_prob, sample.size → sample_size
  • graphlet_proj(): Mu → mu

Count prefixes (no.of., nb., num.) follow the n convention, as in #2946.

All are pure registry renames except cluster_fluid_communities(), which takes its head argument through a trailing deprecated() sentinel. The deprecated wrappers (spinglass.community(), graph.motifs(), hrg.predict(), …) are untouched and forward the old names through the recovery.

graphlets() still returns its weights as $Mu. That is a return-value element, not an argument, so it is out of scope.

Tests

There are table-driven expect_legacy_arg() tests for every rename. same_result() in the helper now compares classed lists such as communities element by element, because length.communities() counts communities, not list elements.

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) ← this PR
  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

…f and graphlet functions

Count prefixes follow the `n` convention (`nb.trials` → `n_trials`,
`num.samples` → `n_samples`, `no.of.communities` → `n_communities`),
and `graphlet_proj(Mu)` becomes `mu`.
Legacy names are recovered with a soft-deprecation.

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

  • ✔️E_named: 211ms -> 211ms [-0.37%, +1.13%]
  • ✔️V_named: 441ms -> 440ms [-0.72%, +0.32%]
  • 🚀all_simple_paths_named: 153ms -> 152ms [-0.59%, -0.03%]
  • ✔️as_adjacency_matrix: 242ms -> 241ms [-0.68%, +0.06%]
  • ✔️as_biadjacency_matrix: 257ms -> 258ms [-0.16%, +0.65%]
  • ✔️as_data_frame_both: 266ms -> 266ms [-0.58%, +0.12%]
  • ✔️as_long_data_frame: 211ms -> 212ms [-0.15%, +0.73%]
  • ✔️ego_order2_named: 163ms -> 163ms [-0.75%, +0.47%]
  • ✔️es_attr_assign: 239ms -> 239ms [-0.59%, +0.1%]
  • ✔️es_attr_filter: 246ms -> 246ms [-0.58%, +0.19%]
  • ✔️graph_from_adjacency_matrix: 275ms -> 276ms [-0.14%, +0.67%]
  • ✔️graph_from_data_frame: 284ms -> 285ms [-0.6%, +0.94%]
  • ✔️head_of_named: 185ms -> 185ms [-1.21%, +0.55%]
  • ✔️incident_edges: 210ms -> 210ms [-0.58%, +0.34%]
  • ✔️max_cliques_named: 26.2ms -> 26.2ms [-0.67%, +0.24%]
  • 🚀neighbors_by_name: 332ms -> 330ms [-1.29%, -0.11%]
  • ✔️union_named: 233ms -> 233ms [-0.66%, 0%]
  • ✔️vs_attr_filter: 336ms -> 336ms [-0.61%, +0.38%]
  • ✔️vs_by_name: 307ms -> 308ms [-0.09%, +0.73%]
    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-12

# Conflicts:
#	man/graphlet_basis.Rd
#	man/graphlets.project.Rd
…e-2788-subagents-faw1t1-12

# Conflicts:
#	R/community.R
#	R/glet.R
#	R/hrg.R
#	R/motifs.R
#	tests/testthat/test-community.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 f8ea934 is merged into claude/issue-2788-subagents-faw1t1-11:

Status Name Current Incoming Interval
✔️ V_named 369.5ms 367.6ms [-1.64%, +0.58%]
✔️ graph_from_data_frame 225.9ms 226.3ms [-0.93%, +1.26%]
✔️ graph_from_adjacency_matrix 218.5ms 219.4ms [-0.18%, +1.07%]
✔️ vs_by_name 215.4ms 215.6ms [-0.52%, +0.74%]
✔️ vs_subset_positional 190.2ms 190.2ms [-0.54%, +0.54%]
✔️ es_attr_assign 186.8ms 188.2ms [0%, +1.5%]
✔️ es_attr_filter 187.4ms 187.5ms [-0.6%, +0.77%]
✔️ as_biadjacency_matrix 186.8ms 186.2ms [-0.99%, +0.26%]
✔️ as_data_frame_both 176.3ms 176.3ms [-0.51%, +0.49%]
✔️ vs_attr_filter 174.2ms 173.9ms [-0.74%, +0.46%]
✔️ max_cliques_sizes_named 173ms 173.3ms [-0.29%, +0.63%]
✔️ E_named 176.4ms 172.1ms [-5.32%, +0.4%]
✔️ incident_edges 165.6ms 166.9ms [-0.19%, +1.78%]
❗🐌 as_adjacency_matrix 162.7ms 163.4ms [+0.02%, +0.82%]
✔️ as_long_data_frame 158.1ms 158.8ms [-0.81%, +1.77%]
✔️ head_of_named 151.8ms 152.2ms [-0.66%, +1.19%]
✔️ union_named 151.2ms 151.5ms [-0.88%, +1.22%]
✔️ ego_order2_named 148.9ms 149.8ms [-0.62%, +1.84%]
✔️ neighbors_by_name 134.7ms 134.1ms [-1.12%, +0.24%]
✔️ all_simple_paths_named 126.4ms 126.6ms [-0.35%, +0.65%]
✔️ vs_by_literal_name 99.8ms 99.3ms [-1.83%, +0.9%]
❗🐌 degree_few_vertices 84.1ms 84.8ms [+0.06%, +1.6%]
✔️ strength_weighted_named 31.5ms 31.5ms [-1.09%, +1.12%]
✔️ max_cliques_named 22.8ms 22.8ms [-0.75%, +0.56%]

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

Last updated for commit f8ea934.

schochastics and others added 4 commits December 2, 2026 21:19
…tweenness()

The snake_case sweep also renamed the result component in the
description, but the C glue still returns it as `edge.betweenness`;
only the argument was renamed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schochastics schochastics reopened this Dec 3, 2026
@schochastics schochastics reopened this Dec 3, 2026
schochastics and others added 6 commits December 3, 2026 09:33
…e-2788-subagents-faw1t1-12

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

# Conflicts:
#	tests/testthat/_snaps/structural-properties.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@schochastics schochastics reopened this Dec 3, 2026
@schochastics schochastics reopened this Dec 3, 2026
@schochastics schochastics reopened this Dec 3, 2026
@schochastics
schochastics merged commit 60169fd into main Dec 3, 2026
12 checks passed
@schochastics
schochastics deleted the claude/issue-2788-subagents-faw1t1-12 branch December 3, 2026 20:01
schochastics added a commit to schochastics/rigraph that referenced this pull request Dec 4, 2026
…f and graphlet functions (igraph#2948)

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>
(cherry picked from commit 60169fd)
schochastics added a commit to schochastics/rigraph that referenced this pull request Dec 4, 2026
…f and graphlet functions (igraph#2948)

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>
(cherry picked from commit 60169fd)
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