Skip to content

refactor: move optional arguments of plotting functions behind the ellipsis - #2777

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

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

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 7 exported plotting 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/plotting.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
igraph_opt() x default
curve_multiple() graph start
add_shape() shape clip, plot, parameters
tk_close() tkp.id window.close
tk_coords() tkp.id norm
tk_fit() tkp.id width, height
tk_rotate() tkp.id degree, rad

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-plotting branch from f5584a2 to b7199eb Compare July 26, 2026 10:53
@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-plotting branch from b7199eb to 0f7d122 Compare July 26, 2026 16:24
…lipsis

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

Functions: add_shape, curve_multiple, igraph_opt, tk_close, tk_coords, tk_fit, tk_rotate

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 ff39dd5 is merged into main:

  • ✔️as_adjacency_matrix: 862ms -> 864ms [-0.79%, +1.34%]
  • ✔️as_biadjacency_matrix: 827ms -> 828ms [-1%, +1.17%]
  • ✔️as_data_frame_both: 1.75ms -> 1.73ms [-3.52%, +0.65%]
  • ✔️as_long_data_frame: 4.48ms -> 4.4ms [-4.52%, +0.87%]
  • ✔️es_attr_filter: 3.01ms -> 3.02ms [-2.54%, +2.68%]
  • ✔️graph_from_adjacency_matrix: 132ms -> 132ms [-2.74%, +2.23%]
  • ✔️graph_from_data_frame: 3.64ms -> 3.67ms [-0.43%, +2.07%]
  • ✔️vs_attr_filter: 1.71ms -> 1.69ms [-2.62%, +1.1%]
  • ✔️vs_by_name: 1.12ms -> 1.11ms [-3.06%, +1.58%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

Argument-coverage tests for the ellipsis migration of
`add_shape()`, `curve_multiple()`, `igraph_opt()`,
`tk_close()`, `tk_coords()`, `tk_fit()` and `tk_rotate()`:
every keyword-only tail argument passed by name,
plus the legacy positional recovery path with its deprecation.
The tk_*() helpers are exercised through the failing plot-ID lookup,
since headless test runs cannot open a Tk window.

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 f0c6513 is merged into main:

  • ✔️as_adjacency_matrix: 853ms -> 852ms [-1.06%, +0.81%]
  • ✔️as_biadjacency_matrix: 817ms -> 818ms [-1.35%, +1.75%]
  • 🚀as_data_frame_both: 1.67ms -> 1.63ms [-4.29%, -0.23%]
  • ✔️as_long_data_frame: 4.21ms -> 4.22ms [-2.79%, +3.1%]
  • ✔️es_attr_filter: 2.97ms -> 2.96ms [-3.48%, +2.61%]
  • ✔️graph_from_adjacency_matrix: 134ms -> 134ms [-2.04%, +1.45%]
  • ❗🐌graph_from_data_frame: 3.57ms -> 3.63ms [+0.2%, +3.21%]
  • 🚀vs_attr_filter: 1.7ms -> 1.67ms [-3.62%, -0.21%]
  • ✔️vs_by_name: 1.1ms -> 1.1ms [-2.32%, +2.14%]
    Further explanation regarding interpretation and methodology can be found in the documentation.

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