-
-
Notifications
You must be signed in to change notification settings - Fork 206
chore: Use autogenerated _impl functions instead of .Call()
#2471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…games, layout Co-authored-by: krlmlr <[email protected]>
Co-authored-by: krlmlr <[email protected]>
|
@copilot: Resolve conflicts and proceed. |
Co-authored-by: krlmlr <[email protected]>
krlmlr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot: Resolve conflicts, adhere to feedback.
R/community.R
Outdated
| cli::cli_abort("Membership is not a numerical vector") | ||
| } | ||
| membership <- as.numeric(membership) | ||
| # Pre-process weights to match old behavior |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more preprocessing needed, this was a bug that's now fixed in main.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed weight preprocessing. The modularity_impl now handles this correctly. Fixed in 0d7575e.
R/rewire.R
Outdated
| multiple = FALSE, | ||
| mode = c("all", "out", "in", "total") | ||
| ) { | ||
| mode_char <- igraph_match_arg(mode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to mode, check on strings instead of numbers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to mode and updated to check on strings (mode != "all" && mode != "total") instead of numeric values. Fixed in 0d7575e.
- Remove weight preprocessing in modularity.igraph (fixed in main) - Rename mode_char to mode and check strings instead of numbers in rewire.R Co-authored-by: krlmlr <[email protected]>
_impl functions instead of .Call()
Switching to autogenerated
_implfunctionsThis PR addresses the issue of replacing
.Call()usage with corresponding_implfunctions where they exist.Summary
Successfully replaced all 24
.Call()invocations with_implfunction calls across 11 files, maintaining original behavior while following codebase conventions.Implementation Details
_implhandle it_implfunctions now properly handle automatic weight fetching (fixed in main branch)_implfunctions handle thisFiles Changed
R/centrality.R- closeness_cutoffR/community.R- modularity, community_fluid_communitiesR/flow.R- st_mincutR/games.R- erdos_renyi_game_gnm, preference_game, asymmetric_preference_gameR/layout.R- layout_davidson_harel, layout_gem, layout_sugiyamaR/make.R- extended_chordal_ring (2 occurrences)R/rewire.R- rewire_directed_edgesR/scan.R- local_scan_* functions (8 occurrences)R/structural-properties.R- maximum_bipartite_matchingR/topology.R- get_isomorphisms_vf2, get_subisomorphisms_vf2R/hrg.R- hrg_predictR/versions.R- vcount (intentionally skipped - uses.Call()to avoid recursion)Recent Changes
modularity.igraph()(bug fixed in main)mode_chartomodeinrewire.Rand updated to check on stringsTesting
Closes #2434
Original prompt
_implfunctions instead of using `.Call() #2434✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.