Standardize vertex selector parameter name to `vids`
Functions calculating results per vertex used inconsistent parameter names: nodes, v, or vids. This standardizes all to vids.
Changed functions
nodes → vids:
-
ego(),ego_size(),make_ego_graph()(and theirneighborhood*aliases) -
constraint() -
alpha_centrality()(including internal helpersalpha.centrality.{dense,sparse}) -
power_centrality()(including internal helpersbonpow.{dense,sparse})
v → vids:
-
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.