rigraph icon indicating copy to clipboard operation
rigraph copied to clipboard

Standardize algorithm parameter names from `algo`/`method` to `algorithm`

Open Copilot opened this issue 4 months ago • 0 comments

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:

  • algoalgorithm: page_rank(), feedback_arc_set(), feedback_vertex_set()
  • methodalgorithm: 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.R and src/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 algorithm as a parameter names (e.g. shortest_paths, sample_pa, etc.), some others use algo (e.g. page_rank, feedback_arc_set, etc.), and yet others use method (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.

Copilot avatar Oct 28 '25 22:10 Copilot