Skip to content

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

Open
krlmlr wants to merge 1 commit into
mainfrom
claude/ellipsis-plotting
Open

refactor: move optional arguments of plotting functions behind the ellipsis#2777
krlmlr wants to merge 1 commit 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.

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