Skip to content

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

Open
schochastics wants to merge 22 commits into
claude/issue-2788-subagents-faw1t1-11from
claude/issue-2788-subagents-faw1t1-12
Open

schochastics wants to merge 22 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

krlmlr and others added 4 commits October 15, 2026 19:32
…patch/` (#2934)

Co-authored-by: Claude <noreply@anthropic.com>
…r's series loop does (#2935)

Co-authored-by: Claude <noreply@anthropic.com>
…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.

github-actions Bot and others added 11 commits October 16, 2026 00:17
Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
…ing's setup (#2949)

Co-authored-by: Claude <noreply@anthropic.com>
…edit is vendored (#2956)

Co-authored-by: Claude <noreply@anthropic.com>
… them (#2957)

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: krlmlr <krlmlr@users.noreply.github.com>
…s fixes in front of the vendor commits (#2959)

Co-authored-by: Claude <noreply@anthropic.com>
…-no-push-dev` (#2961)

Co-authored-by: Claude <noreply@anthropic.com>
… upstream function (#2966)

Co-authored-by: Claude <noreply@anthropic.com>
…s-land.sh --review --series` (#2970)

Co-authored-by: Claude <noreply@anthropic.com>
krlmlr and others added 4 commits October 18, 2026 11:12
…n the tree (#2968)

Co-authored-by: Claude <noreply@anthropic.com>
…ync (#2958)

Co-authored-by: Claude <noreply@anthropic.com>
… fold applied (#2965)

Co-authored-by: Claude <noreply@anthropic.com>
@krlmlr
krlmlr added this pull request to stack #2872 October 18, 2026 09:34
schochastics and others added 3 commits October 18, 2026 11:35
…d input

`igraph_match_arg()` eagerly computed `rlang::caller_arg()` and went
through `rlang::arg_match()` on every call, costing ~19 us even when the
value is valid. It now returns early for the two cases `arg_match()`
accepts (the untouched default, or a single exact match) and only pays
for the error machinery when it has to report one.

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

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.

2 participants