rigraph icon indicating copy to clipboard operation
rigraph copied to clipboard

Standardize vertex selector parameter name to `vids`

Open Copilot opened this issue 4 months ago • 0 comments

Functions calculating results per vertex used inconsistent parameter names: nodes, v, or vids. This standardizes all to vids.

Changed functions

nodesvids:

  • ego(), ego_size(), make_ego_graph() (and their neighborhood* aliases)
  • constraint()
  • alpha_centrality() (including internal helpers alpha.centrality.{dense,sparse})
  • power_centrality() (including internal helpers bonpow.{dense,sparse})

vvids:

  • betweenness()
  • cocitation(), bibcoupling()
  • degree()
  • distances()

Example

g <- make_ring(10)

# Before: inconsistent naming
ego(g, nodes = 1:3)
betweenness(g, v = 1:3)

# After: consistent naming
ego(g, vids = 1:3)
betweenness(g, vids = 1:3)

Positional arguments remain unchanged for backward compatibility.

Original prompt

This section details on the original issue you should resolve

<issue_title>Inconsistent naming of vertex selector parameters</issue_title> <issue_description>Functions that calculate a result for each vertex (or a subset of vertices) typically have a vertex selector parameter, controlling which specific vertices to include.

This parameter is usually called vids, but not always. This issue is to make sure that the naming is consistent across all functions.

Incomplete functions that don't use vids:

  • nodes: ego()/neighborhood() and related, constraint(), alpha_centrality(), power_centrality(), ...
  • v: betweenness, cocitation, bibcoupling, degree, distances, ...
  • vids: closeness, similarity, transitivity, strength, page_rank, induced_subgraph, diversity, knn, eccentricity, ...</issue_description>

Comments on the Issue (you are @copilot in this section)

  • Fixes igraph/rigraph#691

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Oct 28 '25 22:10 Copilot