Skip to content

refactor: Replace _impl aliases with explicit wrappers in R/embedding.R#2380

Merged
krlmlr merged 5 commits intomainfrom
copilot/replace-impl-aliases-in-embedding-r
Oct 25, 2025
Merged

refactor: Replace _impl aliases with explicit wrappers in R/embedding.R#2380
krlmlr merged 5 commits intomainfrom
copilot/replace-impl-aliases-in-embedding-r

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 25, 2025

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

Changes

  • embed_adjacency_matrix: Replaced alias with wrapper forwarding 7 parameters (graph, no, weights, which, scaled, cvec, options)
  • dim_select: Replaced alias with wrapper forwarding single parameter (sv)
  • embed_laplacian_matrix: Replaced alias with wrapper forwarding 7 parameters (graph, no, weights, which, type, scaled, options)

Example

Before:

embed_adjacency_matrix <- adjacency_spectral_embedding_impl

After:

embed_adjacency_matrix <- function(graph, no, weights = NULL, which = c("lm", "la", "sa"), scaled = TRUE, cvec = strength(graph, weights = weights) / (vcount(graph) - 1), options = arpack_defaults()) {
  adjacency_spectral_embedding_impl(
    graph = graph,
    no = no,
    weights = weights,
    which = which,
    scaled = scaled,
    cvec = cvec,
    options = options
  )
}

All wrappers use explicit arg = arg notation. Function signatures match their corresponding _impl functions exactly.

Original prompt

This section details on the original issue you should resolve

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

Functions to update:

  • embed_adjacency_matrix <- adjacency_spectral_embedding_impl
  • dim_select <- dim_select_impl
  • embed_laplacian_matrix <- laplacian_spectral_embedding_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/embedding.R</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.

Co-authored-by: krlmlr <1741643+krlmlr@users.noreply.github.com>
Copilot AI changed the title [WIP] Replace _impl aliases in R/embedding.R with explicit wrappers Replace _impl aliases with explicit wrappers in R/embedding.R Oct 25, 2025
Copilot AI requested a review from krlmlr October 25, 2025 17:30
@krlmlr krlmlr changed the title Replace _impl aliases with explicit wrappers in R/embedding.R refactor: Replace _impl aliases with explicit wrappers in R/embedding.R Oct 25, 2025
@krlmlr krlmlr marked this pull request as ready for review October 25, 2025 17:41
@krlmlr krlmlr enabled auto-merge (squash) October 25, 2025 17:41
@krlmlr krlmlr disabled auto-merge October 25, 2025 18:31
@krlmlr krlmlr merged commit 17b0c6a into main Oct 25, 2025
@krlmlr krlmlr deleted the copilot/replace-impl-aliases-in-embedding-r branch October 25, 2025 18:32
krlmlr added a commit that referenced this pull request Oct 25, 2025
…ing.R` (#2380)

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/embedding.R

2 participants