Skip to content

Forward keyword arguments in profile_solvers - #208

Open
arnavk23 wants to merge 2 commits into
JuliaSmoothOptimizers:mainfrom
arnavk23:issue-143-bp-kwargs
Open

Forward keyword arguments in profile_solvers#208
arnavk23 wants to merge 2 commits into
JuliaSmoothOptimizers:mainfrom
arnavk23:issue-143-bp-kwargs

Conversation

@arnavk23

@arnavk23 arnavk23 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #143. profile_solvers gains a bp_kwargs keyword so backend-specific options (e.g. logscale) can be forwarded to each BenchmarkProfiles.performance_profile call, separately from the kwargs passed to the final plot call that assembles the profile wall.

This reimplements the approach from #200 on top of current main (which has gained the rotate option since #200 was opened) and addresses the review feedback left there by Copilot:

  • Breaking-change concern: performance_profile's public signature, including the args... passthrough, is left untouched — no behavior removed.
  • bp_kwargs typing: typed as AbstractDict{Symbol} (default Dict{Symbol,Any}()) rather than a bare Dict, so any Symbol-keyed dict works.
  • Keyword collisions: bp_kwargs is merged with the internal defaults (palette, title, legend) instead of being splatted after them, so bp_kwargs entries take precedence and duplicate-keyword errors can't occur.

Test plan

  • Added tests in test/profiles.jl exercising bp_kwargs (e.g. logscale = false) and confirming overriding internal defaults like legend/palette via bp_kwargs doesn't error.
  • Ran the full test suite locally (Pkg.test()); all tests pass.

🤖 Generated with Claude Code

… profile_solvers

Adds a `bp_kwargs` keyword to `profile_solvers` so backend-specific options
such as `logscale` can be forwarded to each `BenchmarkProfiles.performance_profile`
call, separately from the `kwargs` passed to the final `plot` call. Addresses
review feedback from PR JuliaSmoothOptimizers#200: `bp_kwargs` accepts any `AbstractDict{Symbol}`
(not just `Dict`), and its entries are merged with (and take precedence over)
the internal `palette`/`title`/`legend` defaults instead of being splatted
after them, avoiding duplicate-keyword errors. `performance_profile`'s public
signature (including `args...`) is left untouched to avoid a breaking change.

Fixes JuliaSmoothOptimizers#143

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 3, 2026 23:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The profile_solvers docstring currently overstates bp_kwargs precedence for title despite rotate = true later overwriting titles, which should be corrected to avoid misleading API documentation.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR updates profile_solvers to accept a separate bp_kwargs keyword argument so backend-specific options can be forwarded to each BenchmarkProfiles.performance_profile call, while keeping kwargs... reserved for the final plot call that assembles the profile wall.

Changes:

  • Added bp_kwargs keyword to profile_solvers and merged it with internal defaults (palette, title, legend) so user-provided values take precedence without duplicate-keyword errors.
  • Updated internal calls to explicitly use BenchmarkProfiles.performance_profile and pass merged keyword arguments via splatting.
  • Added tests to ensure bp_kwargs is accepted and can override internal defaults without error.
File summaries
File Description
src/profiles.jl Adds bp_kwargs to profile_solvers and forwards merged backend kwargs into each BenchmarkProfiles.performance_profile call.
test/profiles.jl Adds coverage that bp_kwargs is accepted and that overriding defaults (e.g., legend, palette) does not error.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/profiles.jl Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@arnavk23 arnavk23 changed the title Forward keyword arguments to BenchmarkProfiles.performance_profile in profile_solvers Forward keyword arguments in profile_solvers Sep 3, 2026
@arnavk23

arnavk23 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@dpo I think we can finally close the issue now. Also this supersedes #200

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.

performance_profile() doesn't passe kwargs to BenchmarkProfiles.performance_profiles()

2 participants