Skip to content

refactor: snake_case the dotted arguments of the structural and conversion functions - #2950

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

schochastics merged 31 commits into
claude/issue-2788-subagents-faw1t1-12from
claude/issue-2788-subagents-faw1t1-13

Conversation

@schochastics

@schochastics schochastics commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Part of #2788 (PR 13 of the stack, on top of #2948). It is the last part of the snake_case sweep and covers the remaining structural, conversion and utility functions. It also finishes the selector rename deferred in #2864.

What this does

Dots become underscores, and no.sim → n_sim follows the count convention:

Function Renamed
graph_from_adjacency_matrix(), from_adjacency() add.colnames, add.rownames
graph_from_biadjacency_matrix() add.names
graph_from_graphnel() unlist.attrs
assortativity() values.in
bipartite_projection() remove.type
centralize() theoretical.max
export_pajek() project.file
component_distribution() mul.size
decompose() max.comps, min.vertices
fit_power_law() force.continuous, p.value, p.precision
min_cut() value.only
local_scan() graph.us, graph.them
simplify() remove.multiple, remove.loops
sir() no.sim → n_sim
stochastic_matrix() column.wise
shortest_paths() inbound.edges
subgraph_from_edges() delete.vertices
reciprocity() ignore.loops
knn() neighbor.degree.mode
dfs() order.out, in.callback, out.callback

Tail arguments with a registry entry are pure registry renames. Head arguments keep the old name as a trailing deprecated() formal. Where the function has a registry entry (simplify(), local_scan(), fit_power_law()), the generated block handles the rename (see #2859); fit_power_law() and local_scan() pass their ... on, so their entries set passthrough_dots. assortativity(), component_distribution() and dfs() have no registry entry and use a hand-written bridge.

eccentricity(vids) → vertices: #2864 left this one out because of its hand-rolled ... handling. A hand-written bridge on a trailing vids = deprecated() formal works regardless, and vertices = NULL now selects all vertices like the other selectors.

Internal live callers now use the new names: the without_loops()/without_multiples() modifiers and the sparse power_centrality()/alpha_centrality() helpers (simplify()), and scan_stat() (local_scan()). Deprecated wrappers are untouched. The subgraph.edges() snapshot accepts the extra soft-deprecation the frozen wrapper now triggers.

After this PR

Among non-deprecated exported functions, the only dotted argument names left are the deliberate exclusions: plot.igraph(), print.igraph(), the tkplot API (tkp.id, window.close), indent_print(), and the trailing deprecated() formals that keep the legacy names. subgraph(vids) stays as well: its docs announce that subgraph_from_edges() takes over the name.

Found along the way (unchanged, already on main)

  • component_distribution(mul.size = TRUE) always warns "longer object length is not a multiple of shorter object length".
  • shortest_paths(inbound.edges = TRUE) errors with "Unknown edge selected", even on a plain directed ring.

The legacy-name tests use FALSE for these two arguments.

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

…rsion functions

Also renames `eccentricity(vids)` to `vertices`, the selector left over from #2864.
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 5ce5046 is merged into claude/issue-2788-subagents-faw1t1-12:

  • ✔️E_named: 236ms -> 242ms [-1.57%, +6.71%]
  • ✔️V_named: 453ms -> 454ms [-0.66%, +1.17%]
  • ✔️all_simple_paths_named: 140ms -> 140ms [-0.37%, +0.5%]
  • ✔️as_adjacency_matrix: 253ms -> 254ms [-0.24%, +0.93%]
  • ✔️as_biadjacency_matrix: 273ms -> 272ms [-1.37%, +0.95%]
  • ✔️as_data_frame_both: 251ms -> 250ms [-0.73%, +0.22%]
  • ✔️as_long_data_frame: 200ms -> 199ms [-1.31%, +0.28%]
  • ✔️ego_order2_named: 158ms -> 160ms [-0.73%, +3.03%]
  • ✔️es_attr_assign: 249ms -> 248ms [-1.33%, +0.35%]
  • ✔️es_attr_filter: 250ms -> 251ms [-0.59%, +0.64%]
  • ✔️graph_from_adjacency_matrix: 304ms -> 304ms [-0.71%, +0.44%]
  • ✔️graph_from_data_frame: 279ms -> 279ms [-0.75%, +0.62%]
  • ✔️head_of_named: 175ms -> 174ms [-1.27%, +0.13%]
  • 🚀incident_edges: 184ms -> 182ms [-2.04%, -0.31%]
  • ✔️max_cliques_named: 26ms -> 25.8ms [-3.48%, +1.66%]
  • ✔️neighbors_by_name: 248ms -> 244ms [-4.29%, +0.86%]
  • ✔️union_named: 250ms -> 251ms [-2.57%, +3.5%]
  • ✔️vs_attr_filter: 271ms -> 283ms [-1.17%, +9.95%]
  • ✔️vs_by_name: 224ms -> 224ms [-0.89%, +1.37%]
    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 7 commits October 18, 2026 10:31
…e-2788-subagents-faw1t1-13

# Conflicts:
#	man/subgraph.Rd
#	man/subgraph.edges.Rd
…e-2788-subagents-faw1t1-13

# Conflicts:
#	R/adjacency.R
#	R/bipartite.R
#	R/centralization.R
#	R/cohesive.blocks.R
#	R/components.R
#	R/conversion.R
#	R/flow.R
#	R/incidence.R
#	R/sir.R
#	R/stochastic_matrix.R
#	R/structural-properties.R
#	tests/testthat/test-adjacency.R
#	tests/testthat/test-assortativity.R
#	tests/testthat/test-incidence.R
@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 a4f4862 is merged into claude/issue-2788-subagents-faw1t1-12:

Status Name Current Incoming Interval
✔️ V_named 423.5ms 420ms [-2.05%, +0.43%]
✔️ graph_from_data_frame 242.6ms 243.6ms [-0.48%, +1.36%]
✔️ graph_from_adjacency_matrix 243ms 243ms [-2%, +1.94%]
✔️ as_biadjacency_matrix 211.6ms 212.4ms [-0.99%, +1.8%]
✔️ vs_subset_positional 211.9ms 208.7ms [-3.09%, +0.11%]
✔️ es_attr_filter 203.6ms 203.6ms [-0.49%, +0.52%]
✔️ es_attr_assign 202.7ms 203.5ms [-0.19%, +0.93%]
✔️ as_adjacency_matrix 196.4ms 194.9ms [-1.72%, +0.22%]
✔️ vs_by_name 194.7ms 194.3ms [-0.7%, +0.3%]
✔️ E_named 184.9ms 185.6ms [-0.58%, +1.24%]
✔️ as_data_frame_both 183.2ms 181.8ms [-2%, +0.44%]
✔️ max_cliques_sizes_named 178.9ms 179.5ms [-0.28%, +0.88%]
❗🐌 as_long_data_frame 157.3ms 159ms [+0.24%, +1.93%]
✔️ vs_attr_filter 155.1ms 153.2ms [-2.52%, +0.11%]
✔️ union_named 151.7ms 152.4ms [-1.3%, +2.26%]
✔️ incident_edges 151.7ms 152.1ms [-1.38%, +1.9%]
✔️ head_of_named 139.8ms 139.1ms [-1.87%, +0.84%]
✔️ ego_order2_named 137.4ms 137.3ms [-1.01%, +0.85%]
✔️ neighbors_by_name 115.7ms 115.3ms [-1.92%, +1.35%]
✔️ all_simple_paths_named 108.2ms 108.2ms [-0.73%, +0.65%]
✔️ vs_by_literal_name 84ms 84.4ms [-1.39%, +2.26%]
✔️ degree_few_vertices 76.6ms 76.8ms [-0.54%, +0.91%]
✔️ strength_weighted_named 26ms 25.8ms [-2.19%, +0.17%]
✔️ max_cliques_named 21.6ms 21.7ms [-0.9%, +1.75%]

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

Last updated for commit a4f4862.

schochastics and others added 5 commits December 2, 2026 21:17
… simplify() docs

The descriptions of `p_value` and `p_precision` had ended up under the
deprecated `p.value` and `p.precision` entries, leaving the new
arguments undocumented apart from their badge. The prose also still
named `p.value`, `value.only` and `remove.multiple`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e-2788-subagents-faw1t1-13

# Conflicts:
#	tests/testthat/test-structural-properties.R
@schochastics schochastics reopened this Dec 3, 2026
@schochastics schochastics reopened this Dec 3, 2026
@schochastics schochastics reopened this Dec 3, 2026
schochastics and others added 3 commits December 3, 2026 15:55
… values follow

These functions had hand-written bridges for their old argument names, so a
call naming the old one and passing the next argument positionally failed
with "supplied more than once". Their registry entries now let the generator
re-match such calls against the old signature.

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 9226253 into main Dec 3, 2026
12 checks passed
@schochastics
schochastics deleted the claude/issue-2788-subagents-faw1t1-13 branch December 3, 2026 20:01
schochastics added a commit to schochastics/rigraph that referenced this pull request Dec 4, 2026
…rsion functions (igraph#2950)

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 9226253)
schochastics added a commit to schochastics/rigraph that referenced this pull request Dec 4, 2026
…rsion functions (igraph#2950)

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 9226253)
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