Standardize algorithm parameter names from `algo`/`method` to `algorithm`
Functions used inconsistent parameter names for algorithm selection: some used algo, others algorithm, and many used method. This standardizes all algorithm-selection parameters to algorithm.
Changes
Renamed parameters with lifecycle deprecation:
-
algo→algorithm:page_rank(),feedback_arc_set(),feedback_vertex_set() -
method→algorithm:sample_tree(),sample_degseq(),realize_degseq(),realize_bipartite_degseq()
Preserved method for non-algorithm parameters:
- Comparison methods:
compare(),similarity() - Isomorphism methods:
isomorphic(),subgraph_isomorphic() - Layout methods:
layout.merge(),merge_coords()
Implementation:
- Updated Stimulus YAML configuration for code generation
- Added workaround for Stimulus parameter renaming in DEPS-based conditionals
- Regenerated
R/aaa-auto.Randsrc/rinterface.c
Example
# New (recommended)
page_rank(g, algorithm = "prpack")
sample_tree(100, algorithm = "lerw")
sample_degseq(degs, algorithm = "configuration")
# Old (deprecated, but still works)
page_rank(g, algo = "prpack") # Warning: use `algorithm` instead
sample_tree(100, method = "lerw") # Warning: use `algorithm` instead
Backward Compatibility
Old parameter names continue to work with soft deprecation warnings via lifecycle::deprecate_warn().
Original prompt
This section details on the original issue you should resolve
<issue_title>Consistency in parameter names: algo vs algorithm vs method</issue_title> <issue_description>At this moment, some functions use
algorithmas a parameter names (e.g.shortest_paths,sample_pa, etc.), some others usealgo(e.g.page_rank,feedback_arc_set, etc.), and yet others usemethod(e.g.sample_degseq,sample_tree, etc.). The naming should be made consistent across functions.</issue_description>Comments on the Issue (you are @copilot in this section)
@maelle Relevant lifecycle doc: https://lifecycle.r-lib.org/articles/communicate.html#renaming-an-argument
- Fixes igraph/rigraph#526
💡 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.