Repository navigation
refactor: Rename index to vertices/edges in the attribute accessors - #2944
Merged
schochastics merged 31 commits intoDec 3, 2026
Merged
schochastics merged 31 commits into
schochastics merged 31 commits into
Conversation
…sors `vertex_attr()`, `vertex_attr<-`, `set_vertex_attr()` and `set_vertex_attrs()` rename `index` to `vertices`; `edge_attr()`, `edge_attr<-` and `set_edge_attr()` rename it to `edges`. Named legacy calls are recovered with a soft-deprecation; positional selectors and positional `value` keep working. Part of #2788. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 15, 2026
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 6430fe9 is merged into claude/issue-2788-subagents-faw1t1-7:
|
…-2788-subagents-faw1t1-8
…-2788-subagents-faw1t1-8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-2788-subagents-faw1t1-8
…-2788-subagents-faw1t1-8
Contributor
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if bd22768 is merged into claude/issue-2788-subagents-faw1t1-7:
Further explanation regarding interpretation and methodology can be found in the documentation. Last updated for commit bd22768. |
…-2788-subagents-faw1t1-8
…-2788-subagents-faw1t1-8
…-2788-subagents-faw1t1-8
…-2788-subagents-faw1t1-8 # Conflicts: # R/attributes.R # tests/testthat/test-attributes.R
…-2788-subagents-faw1t1-8
…-2788-subagents-faw1t1-8
…-2788-subagents-faw1t1-8
…-2788-subagents-faw1t1-8
…-2788-subagents-faw1t1-8
…-2788-subagents-faw1t1-8 # Conflicts: # tests/testthat/_snaps/structural-properties.md
…-2788-subagents-faw1t1-8 # Conflicts: # tests/testthat/_snaps/structural-properties.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-2788-subagents-faw1t1-8
…-2788-subagents-faw1t1-8
… 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>
…-2788-subagents-faw1t1-8
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
…sors (igraph#2944) 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 0a2706b)
schochastics
added a commit
to schochastics/rigraph
that referenced
this pull request
Dec 4, 2026
…sors (igraph#2944) 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 0a2706b)
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 8 of the stack, on top of #2943). It answers the question "Does
indexin the attribute accessors join the selector rename?" with yes (maelle: "Rename"), using thevertices/edgesnames from #2864 and #2943.What this does
vertex_attr(),vertex_attr<-,set_vertex_attr(),set_vertex_attrs():index→verticesedge_attr(),edge_attr<-,set_edge_attr():index→edgesThe family covers both vertices and edges, but each function handles only one of them, so they don't need splitting by type.
set_vertex_attr(),set_edge_attr(),vertex_attr<-andedge_attr<-get registry entries (tools/migrations/attributes.R), so the generated block handles the rename (see #2859).indexstays as a trailingdeprecated()formal. A call that names it is matched again against the pre-3.0.0 signature(graph, name, index, value), soset_vertex_attr(g, "x", index = i, v)still givesvtovalue; it gets one soft-deprecation, and an error if both spellings are supplied. Reverse dependencies use that call shape (CurricularComplexity, martini, miloR).vertex_attr(),edge_attr()andset_vertex_attrs()have no registry entry and keep a hand-written bridge that warns and errors the same way.vertex_attr(g, "name", 2:3)andset_vertex_attr(g, "x", 1:2, 1)work unchanged and without a warning.indexformal comes aftervalue, so a positionalvaluestill binds. Positional calls of that kind exist in package code, e.g.graph_from_data_frame().vertex_attr<-/edge_attr<-, theindexformal sits just beforevalue, because R requiresvalueto be the last formal.Internal calls between the accessors use the new names. The deprecated
get.vertex.attribute()/set.vertex.attribute()and friends are untouched: they still forwardindex =, which is recovered.The
set_vertex_attrs()example about:=now namesvertices, the formal that now shadows a same-named attribute.indexremains a formal, soindex :=is still needed for an attribute of that name.Tests
There are new tests for every legacy spelling, including both replacement functions and the conflict error, plus a check that positional selectors and positional
valuestill bind as before.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/edges← this PRn_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