-
Notifications
You must be signed in to change notification settings - Fork 16
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
[Breaking change] Refactor the way we pass options to MadNLP #191
Conversation
Codecov Report
@@ Coverage Diff @@
## master #191 +/- ##
==========================================
- Coverage 73.00% 72.96% -0.04%
==========================================
Files 38 38
Lines 3456 3459 +3
==========================================
+ Hits 2523 2524 +1
- Misses 933 935 +2
Continue to review full report at Codecov.
|
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.
Thanks for the PR @frapac
Since we introduce a breaking change, maybe it's an excellent time to change some function names. But we can do it in a separate PR.
src/IPM/IPM.jl
Outdated
|
||
@assert is_supported(opt.linear_solver,T) | ||
|
||
# Initiate linear-solver options |
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.
doing this here makes it much cleaner! Great idea
setproperty!(opt,key,parse_option(T,val)) | ||
pop!(option_dict,key) | ||
function set_options!(opt::AbstractOptions, options) | ||
other_options = Dict{Symbol, Any}() |
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.
nice
lib/MadNLPGPU/src/interface.jl
Outdated
MadNLP.check_option_sanity(opt) | ||
|
||
# Initiate linear-solver options |
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.
line 10-26 seems to be redundant to line 104-120 of IPM.jl. Can we create an internal function for setting options?
@sshin23 thanks for the review! I am all in to change the names of the functions in a separate PR |
This PR merges the
option_dict
andkwargs
arguments, so now we pass all options askwargs...
:No need to pass the options in a separate
Dict
anymore.In addition, we add a new function
default_options
to return the default options associated to a given linear solver.