Skip to content

refactor: Replace _impl aliases with explicit wrapper functions in R/structural-properties.R#2372

Merged
krlmlr merged 7 commits intomainfrom
copilot/replace-impl-aliases-structural-properties
Oct 25, 2025
Merged

refactor: Replace _impl aliases with explicit wrapper functions in R/structural-properties.R#2372
krlmlr merged 7 commits intomainfrom
copilot/replace-impl-aliases-structural-properties

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 25, 2025

Replaced direct _impl function aliases with explicit wrapper functions that forward arguments individually.

Changes

Converted 13 functions from direct aliases to explicit wrappers:

  • k_shortest_paths, reciprocity, edge_density
  • feedback_arc_set, feedback_vertex_set
  • which_multiple, any_multiple, count_multiple
  • which_loop, any_loop
  • is_connected, which_mutual, knn

Pattern

Before:

edge_density <- density_impl

After:

edge_density <- function(graph, loops = FALSE) {
  density_impl(
    graph = graph,
    loops = loops
  )
}

Each wrapper explicitly forwards all parameters using arg = arg notation, preserving default values and ... where applicable.

Original prompt

This section details on the original issue you should resolve

<issue_title>Replace _impl aliases in R/structural-properties.R</issue_title>
<issue_description>Goal
Review the code in R/structural-properties.R and replace all direct _impl function aliases with explicit wrapper functions.

Functions to update:

  • k_shortest_paths <- get_k_shortest_paths_impl
  • reciprocity <- reciprocity_impl
  • edge_density <- density_impl
  • feedback_arc_set <- feedback_arc_set_impl
  • feedback_vertex_set <- feedback_vertex_set_impl
  • which_multiple <- is_multiple_impl
  • any_multiple <- has_multiple_impl
  • count_multiple <- count_multiple_impl
  • which_loop <- is_loop_impl
  • any_loop <- has_loop_impl
  • is_connected <- is_connected_impl
  • which_mutual <- is_mutual_impl
  • knn <- avg_nearest_neighbor_degree_impl

Instructions

  1. Review the code to understand the function signatures
  2. Create explicit wrapper functions that forward to the _impl functions
  3. Forward each argument individually and explicitly using arg = arg notation
  4. Do not use ... unless the _impl function itself uses ...

Pattern
Replace direct aliasing like:

func_name <- func_name_impl

With an explicit wrapper:

func_name <- function(arg1, arg2, ...) {
  func_name_impl(
    arg1 = arg1,
    arg2 = arg2,
    ...
  )
}

File
R/structural-properties.R</issue_description>

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


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Copilot AI changed the title [WIP] Replace _impl function aliases in structural-properties Replace _impl aliases with explicit wrapper functions in R/structural-properties.R Oct 25, 2025
Copilot AI requested a review from krlmlr October 25, 2025 16:57
@krlmlr krlmlr marked this pull request as ready for review October 25, 2025 17:06
@krlmlr krlmlr enabled auto-merge (squash) October 25, 2025 17:06
@krlmlr krlmlr disabled auto-merge October 25, 2025 17:25
@krlmlr krlmlr changed the title Replace _impl aliases with explicit wrapper functions in R/structural-properties.R refactor: Replace _impl aliases with explicit wrapper functions in R/structural-properties.R Oct 25, 2025
@krlmlr krlmlr enabled auto-merge (squash) October 25, 2025 17:25
@krlmlr krlmlr disabled auto-merge October 25, 2025 20:39
@krlmlr krlmlr merged commit fa26a90 into main Oct 25, 2025
5 of 6 checks passed
@krlmlr krlmlr deleted the copilot/replace-impl-aliases-structural-properties branch October 25, 2025 20:39
krlmlr added a commit that referenced this pull request Oct 25, 2025
…`R/structural-properties.R` (#2372)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Co-authored-by: Kirill Müller <krlmlr@users.noreply.github.com>
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.

Replace _impl aliases in R/structural-properties.R

2 participants