rigraph
rigraph copied to clipboard
fix: update wrapper functions for C API parameter changes
The autogenerated _impl functions changed their parameter signatures (e.g., loops boolean → allowed_edge_types enum, parameter names using underscores), but wrapper functions and tests weren't updated.
Parameter Type Changes
-
Graph generators:
sample_gnp(),sample_gnm(),sbm_game(),rewire_each_edge()now map booleanloops/multipletoallowed_edge_typesenum ("simple", "loops", "multi", "all") -
Centrality functions:
strength(),centralization_degree()convert booleanloopsto enum ("twice", "none", "once")
Parameter Name Changes (dot → underscore)
Updated wrapper functions and tests:
-
similarity():vit.from/vit.to→from/to -
community_label_propagation():lpa.variant→lpa_variant -
community_leiden():vertex_weights→vertex_out_weights/vertex_in_weights -
community_infomap():e_weights/v_weights→edge_weights/vertex_weights -
biadjacency():incidence→biadjmatrix - Cycle functions:
bfs.cutoff→bfs_cutoff,use.cycle.order→use_cycle_order
Other Fixes
- Added
UNLIMITED = -1constant for autogenerated function defaults - Fixed
graph.isoclass.subgraph()double vertex ID offset (was subtracting 1 twice) - Removed
shanddetailsparameters fromautomorphism_group()(no longer accepted by_impl) - Commented out unavailable
loops/multipleattribute assignments instatic_fitness_game_impl()
Example of typical change pattern:
# Before
sample_gnp(n, p, directed, loops = TRUE)
→ erdos_renyi_game_gnp_impl(n, p, directed, loops = TRUE) # Error!
# After
sample_gnp(n, p, directed, loops = TRUE)
→ erdos_renyi_game_gnp_impl(n, p, directed,
allowed_edge_types = if (loops) "loops" else "simple")
Original prompt
This section details on the original issue you should resolve
<issue_title>Fix tests on
nextbranch</issue_title> <issue_description>Run tests only, ensure they pass. Do not worry about examples ordevtools::check()as part of this task.</issue_description>Comments on the Issue (you are @copilot in this section)
- Fixes igraph/rigraph#2468
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.