Skip to content

refactor: move optional arguments of motifs-graphlets functions behind the ellipsis - #2772

Merged
krlmlr merged 2 commits into
mainfrom
claude/ellipsis-motifs-graphlets
Jul 27, 2026
Merged

refactor: move optional arguments of motifs-graphlets functions behind the ellipsis#2772
krlmlr merged 2 commits into
mainfrom
claude/ellipsis-motifs-graphlets

Conversation

@krlmlr

@krlmlr krlmlr commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Part of the repo-wide ellipsis migration coordinated in #2757
see that PR for the full rationale (CONTRIBUTING.md, Argument Order and the Ellipsis).
Based directly on main (the registry split landed via #2779); a single topic commit.

What this does

Inserts ... between the defining arguments (head) and the optional
modifiers
(tail) of 6 exported motifs-graphlets functions.
Arguments after ... become keyword-only.

  • Legacy positional or abbreviated calls are recovered by the generated
    ARG_HANDLE block and emit a single lifecycle::deprecate_soft("3.0.0", …)
    behavior is unchanged.
  • No defaults change, no arguments are renamed, deprecated functions untouched.
  • Registry: tools/migrations/motifs-graphlets.R; blocks regenerated via
    Rscript tools/generate-migrations.R (idempotent, CI-checked).
  • Rd usage/arguments updated mechanically (see note below).

New signatures

function head (positional) keyword-only tail
graphlet_basis() graph weights
graphlet_proj() graph weights, cliques, niter, Mu
graphlets() graph weights, niter
count_motifs() graph, size cut.prob
motifs() graph, size cut.prob, callback
sample_motifs() graph, size cut.prob, sample.size, sample

Notes for review

  • The environment used to prepare this PR cannot install igraph.r2cdocs
    (GitHub API unreachable), so man/*.Rd files were updated mechanically
    (usage + ... argument item) instead of via devtools::document().
    R CMD check's usage↔formals validation passes; a follow-up
    devtools::document() run may reflow whitespace but should produce no
    semantic diff.
  • Package tests that called these functions positionally were updated to
    named arguments (they are the same soft-deprecation user code will see).

@krlmlr
krlmlr force-pushed the claude/ellipsis-motifs-graphlets branch from 898dc46 to 82a23c6 Compare July 26, 2026 10:52
@krlmlr
krlmlr marked this pull request as ready for review July 26, 2026 15:03
@krlmlr krlmlr closed this Jul 26, 2026
@krlmlr
krlmlr force-pushed the claude/ellipsis-motifs-graphlets branch from 82a23c6 to 0f7d122 Compare July 26, 2026 16:24
…d the ellipsis

Insert `...` between the defining arguments and the optional
modifiers of 6 functions,
following the zoning rules in CONTRIBUTING.md.
Legacy positional and abbreviated calls are recovered
by the generated ARG_HANDLE blocks
(registry: tools/migrations/motifs-graphlets.R)
and emit a single soft deprecation for igraph 3.0.0.
No defaults change and no arguments are renamed.

Functions: count_motifs, graphlet_basis, graphlet_proj, graphlets, motifs, sample_motifs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
@krlmlr krlmlr reopened this Jul 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if f38d2e2 is merged into main:

  • ✔️as_adjacency_matrix: 819ms -> 822ms [-0.93%, +1.68%]
  • ✔️as_biadjacency_matrix: 863ms -> 874ms [-2.26%, +4.66%]
  • ✔️as_data_frame_both: 1.57ms -> 1.57ms [-2.26%, +2.48%]
  • ✔️as_long_data_frame: 4.08ms -> 4.05ms [-3.18%, +1.71%]
  • 🚀es_attr_filter: 3.11ms -> 3.02ms [-4.86%, -0.43%]
  • ✔️graph_from_adjacency_matrix: 149ms -> 151ms [-2.33%, +5.19%]
  • ✔️graph_from_data_frame: 3.64ms -> 3.65ms [-1.27%, +1.72%]
  • ✔️vs_attr_filter: 1.77ms -> 1.77ms [-1.26%, +2.01%]
  • ✔️vs_by_name: 1.16ms -> 1.17ms [-0.54%, +2.44%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
@github-actions

Copy link
Copy Markdown
Contributor

This is how benchmark results would change (along with a 95% confidence interval in relative change) if afe604e is merged into main:

  • ✔️as_adjacency_matrix: 887ms -> 884ms [-1.86%, +1.04%]
  • ✔️as_biadjacency_matrix: 851ms -> 855ms [-0.88%, +1.8%]
  • ✔️as_data_frame_both: 1.63ms -> 1.64ms [-1.86%, +3.1%]
  • ✔️as_long_data_frame: 4.09ms -> 4.07ms [-2.34%, +1.47%]
  • ✔️es_attr_filter: 2.89ms -> 2.89ms [-2.22%, +2.33%]
  • ✔️graph_from_adjacency_matrix: 166ms -> 166ms [-1.55%, +1.1%]
  • ✔️graph_from_data_frame: 3.57ms -> 3.53ms [-2.86%, +0.34%]
  • ✔️vs_attr_filter: 1.7ms -> 1.69ms [-3.32%, +2.01%]
  • ✔️vs_by_name: 1.1ms -> 1.09ms [-4.45%, +3.85%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@krlmlr
krlmlr merged commit 269d0fc into main Jul 27, 2026
9 checks passed
@krlmlr
krlmlr deleted the claude/ellipsis-motifs-graphlets branch July 27, 2026 17:36
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.

2 participants