Repository navigation
chore: pass explicit vertex-pair vectors in internal edge callers - #2954
Open
schochastics wants to merge 2 commits into
Open
schochastics wants to merge 2 commits into
schochastics wants to merge 2 commits into
Conversation
Internal callers of `add_edges()`, `make_graph()` and `get_edge_ids()` no longer pass 2 x n matrices. They use `to_vertex_pairs()` / `edgelist_to_vertex_pairs()` instead, so they do not depend on how matrices are interpreted. `el_to_vec()` gains `arg` and `fn` so its messages can name the calling function. No user-visible behavior change. Split out of #2700. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if d9a4ef0 is merged into main:
|
This branch has not been deployed
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.
Summary
This holds the internal part of #2700, split out as requested there. It is meant to merge either way. #2700 is now stacked on top of it and contains only the user-facing change.
graph_from_edgelist(),graph_from_data_frame(), the sparse adjacency and incidence constructors, and[<-no longer pass 2 × n matrices toadd_edges()/make_graph()/get_edge_ids().They pass interleaved vertex-pair vectors built with two small helpers,
to_vertex_pairs(from, to)andedgelist_to_vertex_pairs(el).This means they keep working however matrix input to those functions is interpreted later.
el_to_vec()gainsargandfn, so its error and deprecation messages can name the caller.The defaults keep the current
get_edge_ids(vp = )wording, so no snapshots change.No user-visible behavior change is intended.
A revdep4 run on this branch should confirm that.
Tests
Added tests for the helpers and for
graph_from_edgelist()/graph_from_data_frame()with exactly two edges.🤖 Generated with Claude Code