Skip to content

refactor: move optional arguments of operators functions behind the ellipsis - #2773

Merged
krlmlr merged 4 commits into
mainfrom
claude/ellipsis-operators
Jul 27, 2026
Merged

refactor: move optional arguments of operators functions behind the ellipsis#2773
krlmlr merged 4 commits into
mainfrom
claude/ellipsis-operators

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 3 exported operators 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/operators.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
complementer() graph loops
compose() g1, g2 byname, graph.attr.comb, vertex.attr.comb, edge.attr.comb
each_edge() prob loops, multiple, mode

Placement rethink: keeping_degseq() was originally migrated here with an
empty head (all arguments keyword-only) — such signatures are now
disallowed (the head must never be empty; see the updated rule in #2757), so
it was dropped from this PR and keeps its original signature.

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-operators branch from e325966 to 6e27125 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-operators branch from 6e27125 to 0f7d122 Compare July 26, 2026 16:24
@krlmlr krlmlr reopened this Jul 26, 2026
…llipsis

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

Functions: complementer, compose, each_edge, keeping_degseq

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016M32izVHZPfxAqemAe4BrX
@krlmlr
krlmlr force-pushed the claude/ellipsis-operators branch from a8c5142 to 40f194b Compare July 26, 2026 19:26
@github-actions

Copy link
Copy Markdown
Contributor

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

  • ✔️as_adjacency_matrix: 817ms -> 814ms [-1.27%, +0.51%]
  • ✔️as_biadjacency_matrix: 790ms -> 788ms [-1.2%, +0.69%]
  • ✔️as_data_frame_both: 1.65ms -> 1.62ms [-6.32%, +1.99%]
  • 🚀as_long_data_frame: 4.28ms -> 4.17ms [-4.83%, -0.29%]
  • ✔️es_attr_filter: 2.96ms -> 2.98ms [-2.63%, +3.95%]
  • ✔️graph_from_adjacency_matrix: 123ms -> 122ms [-1.7%, +0.59%]
  • ✔️graph_from_data_frame: 3.5ms -> 3.53ms [-1.2%, +2.76%]
  • ✔️vs_attr_filter: 1.68ms -> 1.69ms [-1.62%, +3.25%]
  • ✔️vs_by_name: 1.11ms -> 1.09ms [-4.02%, +0.43%]
    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 76ee1bb is merged into main:

  • ✔️as_adjacency_matrix: 801ms -> 797ms [-2.13%, +1.15%]
  • ✔️as_biadjacency_matrix: 797ms -> 792ms [-1.58%, +0.12%]
  • ✔️as_data_frame_both: 1.5ms -> 1.52ms [-1.41%, +3.68%]
  • ✔️as_long_data_frame: 3.89ms -> 3.97ms [-3.27%, +7.71%]
  • ✔️es_attr_filter: 2.97ms -> 2.92ms [-6.73%, +3.43%]
  • ✔️graph_from_adjacency_matrix: 125ms -> 125ms [-1.55%, +2.45%]
  • ✔️graph_from_data_frame: 3.37ms -> 3.39ms [-1.65%, +2.53%]
  • ✔️vs_attr_filter: 1.67ms -> 1.63ms [-5.03%, +1.01%]
  • ✔️vs_by_name: 1.05ms -> 1.04ms [-4.47%, +2.45%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

@krlmlr
krlmlr merged commit a058f7f into main Jul 27, 2026
9 checks passed
@krlmlr
krlmlr deleted the claude/ellipsis-operators branch July 27, 2026 17:25
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