Repository navigation
refactor: snake_case the dotted arguments of the graph generators and degree-sequence functions - #2946
Merged
schochastics merged 31 commits intoDec 3, 2026
Conversation
… degree-sequence functions Dots become underscores; count prefixes follow the `n` convention (`no.of.nodes` → `n`, `no.of.edges` → `n_edges`, `islands.n` → `n_islands`). Legacy names are recovered with a soft-deprecation. Adds `expect_legacy_arg()` to the test helpers. Part of #2788. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 15, 2026
Merged
Contributor
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if bbf027d is merged into claude/issue-2788-subagents-faw1t1-9:
|
…-2788-subagents-faw1t1-10
…-2788-subagents-faw1t1-10 # Conflicts: # R/degseq.R # R/games.R # R/make.R # tests/testthat/test-games.R
…-2788-subagents-faw1t1-10
…-2788-subagents-faw1t1-10
…-2788-subagents-faw1t1-10
Contributor
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if efe5018 is merged into claude/issue-2788-subagents-faw1t1-9:
Further explanation regarding interpretation and methodology can be found in the documentation. Last updated for commit efe5018. |
pa_age(pa.exp, aging.exp), sbm(pref.matrix) and chung_lu(in.weights) are caught by their own `deprecated()` sentinels, separately from the sample_*() functions, but the table only exercised the sample_*() side. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-2788-subagents-faw1t1-10 # Conflicts: # tests/testthat/test-games.R
…-2788-subagents-faw1t1-10
…-2788-subagents-faw1t1-10
…-2788-subagents-faw1t1-10 # Conflicts: # R/degseq.R # R/games.R # R/make.R
…-2788-subagents-faw1t1-10 # Conflicts: # R/games.R # tests/testthat/test-games.R
…-2788-subagents-faw1t1-10
…-2788-subagents-faw1t1-10 # Conflicts: # tests/testthat/_snaps/structural-properties.md
…-2788-subagents-faw1t1-10
…-2788-subagents-faw1t1-10 # Conflicts: # tests/testthat/_snaps/structural-properties.md
…-2788-subagents-faw1t1-10 # Conflicts: # tests/testthat/_snaps/structural-properties.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-2788-subagents-faw1t1-10 # Conflicts: # R/games.R
The generator re-matches a call that uses an old head name against the old signature, so the hand-written bridges for registered functions are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-2788-subagents-faw1t1-10 # Conflicts: # R/games.R
… 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
added a commit
to schochastics/rigraph
that referenced
this pull request
Dec 4, 2026
… degree-sequence functions (igraph#2946) 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 c5ca599)
schochastics
added a commit
to schochastics/rigraph
that referenced
this pull request
Dec 4, 2026
… degree-sequence functions (igraph#2946) 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 c5ca599)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #2788 (PR 10 of the stack, on top of #2945). It is the first part of the snake_case sweep ("underscores everywhere", krlmlr's comments listing
no.sim,column.wise,cut.prob,sample.size, …), covering the generators inR/games.R,realize_*degseq()inR/make.R, andis_degseq()/is_graphical()inR/degseq.R.Naming rule
Dots become underscores (
pref.matrix→pref_matrix,out.deg→out_deg). Count prefixes follow thenconvention from #2860 instead of a literal translation:no.of.nodes→n(sample_k_regular(),sample_fitness_pl())no.of.edges→n_edges(sample_fitness(),sample_fitness_pl())islands.n→n_islands(sample_islands())What this does
87 renames across 28 functions (spec twins such as
pa()/pref()/sbm()included):sample_degseq(out.deg, in.deg),sample_sbm(pref.matrix, block.sizes), all foursample_islands()arguments,sample_pa_age(pa.exp, aging.exp)): they keep their position, so positional calls are unchanged. The dotted names stay as trailingdeprecated()formals, and the registry records the head renames, so the generated block handles them (see refactor: Renamealgotoalgorithminpage_rank(),feedback_arc_set()andfeedback_vertex_set()#2859; new entries forchung_lu()/sample_chung_lu(),sample_islands()andis_degseq()). A call that names a dotted argument is matched again against the pre-3.0.0 signature, so positional values after it keep their old meaning.realize_bipartite_degseq(allowed.edge.types)has no registry entry and keeps a hand-written bridge.constructor_spec().is_degseq()→is_graphical()) use the new names. The deprecated*.game()wrappers are untouched; they keep forwarding the dotted names through the recovery.Tests
expect_legacy_arg()(new,helper.R) checks one rename at a time: the legacy call soft-deprecates and returns the same result as the new spelling under the same seed. A table-driven test runs it for every renamed function in this PR. It evaluates the calls in the test's frame, because a call made from inside the helper would count as package-internal and stay silent.Found along the way (unchanged, already on
main)sample_pa_age()errors wheneverout.distorout.seqis given ("Expecting a scalar integer but received a vector of length 0"), so these two arguments are unusable. They're renamed here, but the legacy-name test exercisesout.prefinstead.sample_traits()/sample_traits_callaway()return a list (graph,node_type_vec, …,type.dist,pref.matrix) rather than a graph. The dotted element names are return values, not arguments, so this PR leaves them alone.The #2788 stack
Each PR is based on the previous one and merges in this order:
algotoalgorithminpage_rank(),feedback_arc_set()andfeedback_vertex_set()#2859:algo→algorithmnodestonin generators andcentr_*_tmax()#2860:nodes→n(vertex counts)cluster_infomap()#2861: weights argumentsnormalized#2862: normalization flags →normalizedverticesandvertex#2864: selectors →vertices/vertexedges#2943: edge selectors →edgesindextovertices/edgesin the attribute accessors #2944: attribute accessors:index→vertices/edgesn_iter/max_iter#2945: iterations →n_iter/max_iterMu→mu)algorithmand measure selection tomeasure#2951: algorithm family →algorithm/measure(closes Algorithm-selection argument names: census ofmethod/algorithm/algo/impl/implementation#2932)🤖 Generated with Claude Code