Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 28, 2025

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)


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

Changed parameter names in the following functions:
- Functions using `nodes` → `vids`: ego(), ego_size(), make_ego_graph(), constraint(), alpha_centrality(), power_centrality()
- Functions using `v` → `vids`: betweenness(), cocitation(), bibcoupling(), degree(), distances()

Also updated internal helper functions and documentation.

Co-authored-by: krlmlr <[email protected]>
Copilot AI changed the title [WIP] Fix inconsistent naming of vertex selector parameters Standardize vertex selector parameter name to vids Oct 28, 2025
Copilot AI requested a review from krlmlr October 28, 2025 23:11
Copilot finished work on behalf of krlmlr October 28, 2025 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent naming of vertex selector parameters

2 participants