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
Add optional kwargs to optimize! for optimize_hook #1987
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1987 +/- ##
==========================================
+ Coverage 88.86% 88.86% +<.01%
==========================================
Files 33 33
Lines 4282 4283 +1
==========================================
+ Hits 3805 3806 +1
Misses 477 477
Continue to review full report at Codecov.
|
Done, should the error be thrown sooner to avoid side-effects if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the error be thrown sooner to avoid side-effects if optimizer_factory !== nothing or model.nlp_data !== nothing ?
No, I don't think that's a big issue.
src/optimizer_interface.jl
Outdated
|
||
Optimize the model. If `optimizer_factory` is not `nothing`, it first sets the | ||
optimizer to a new one created using the optimizer factory. The factory can be | ||
created using the [`with_optimizer`](@ref) function. If `optimizer_factory` is | ||
`nothing` and no optimizer was set to `model` before calling this function, a | ||
[`NoOptimizer`](@ref) error is thrown. | ||
|
||
Keyword arguments `kwargs` are passed to the `optimize_hook`. An error is | ||
thrown if `optimize_hook` is `nothing` and keyword arguments are provided |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Please end the sentence with a period.
* Add optional kwargs to optimize! for optimize_hook * Add test for unexpected kwarg error * Add documentation on kwargs to optimize! * Formatting tweak
A simple change to pass along kwargs to the optimize_hook