Skip to content

add Options(options; kws...) for inheriting from an existing options set #1172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thchr
Copy link

@thchr thchr commented Jun 9, 2025

This implements the feature described in #1171. I did not add the deprecated keyword arguments that are possible to pass to the Optim(; kws..) constructor; since this would be new API, it seemed unnecessary.

The implementation is not very DRY, since it needs to repeat the valid keyword arguments - but cleaner solutions would probably require a dependency like SetFields.jl or Accessors.jl, which doesn't feel warranted for a small feature like this.

@thchr thchr mentioned this pull request Jun 9, 2025
Copy link
Contributor

github-actions bot commented Jun 9, 2025

Benchmark Results

master 73ae438... master / 73ae438...
multivariate/solvers/first_order/AdaMax 0.647 ± 0.008 ms 0.647 ± 0.0079 ms 1 ± 0.017
multivariate/solvers/first_order/Adam 0.646 ± 0.0078 ms 0.646 ± 0.0079 ms 1 ± 0.017
multivariate/solvers/first_order/BFGS 0.224 ± 0.0042 ms 0.223 ± 0.0046 ms 1 ± 0.028
multivariate/solvers/first_order/ConjugateGradient 0.0482 ± 0.00057 ms 0.048 ± 0.00062 ms 1 ± 0.018
multivariate/solvers/first_order/GradientDescent 1.71 ± 0.02 ms 1.71 ± 0.014 ms 1 ± 0.014
multivariate/solvers/first_order/LBFGS 0.22 ± 0.0037 ms 0.219 ± 0.004 ms 1 ± 0.025
multivariate/solvers/first_order/MomentumGradientDescent 2.51 ± 0.016 ms 2.51 ± 0.015 ms 1 ± 0.0087
multivariate/solvers/first_order/NGMRES 0.554 ± 0.011 ms 0.552 ± 0.01 ms 1 ± 0.027
time_to_load 0.517 ± 0.0013 s 0.519 ± 0.0042 s 0.996 ± 0.0085

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

Copy link

codecov bot commented Jun 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.76%. Comparing base (adaa8db) to head (73ae438).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1172      +/-   ##
==========================================
+ Coverage   85.73%   85.76%   +0.03%     
==========================================
  Files          46       46              
  Lines        3596     3598       +2     
==========================================
+ Hits         3083     3086       +3     
+ Misses        513      512       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@thchr
Copy link
Author

thchr commented Jun 22, 2025

Gentle bump.

@pkofod
Copy link
Member

pkofod commented Jul 5, 2025

I suppose users could just use https://github.com/JuliaObjects/Accessors.jl and set them themselves....

However, if we expose it as a feature directly of Optim.Options maybe we should not hardcode the list? I would think you could just get the property names and loop over that? Then, if we add a new option it should automatically be covered.

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