Skip to content

[Breaking change] Change names to follow JSO conventions #194

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

Merged
merged 4 commits into from
Aug 18, 2022
Merged

Conversation

sshin23
Copy link
Member

@sshin23 sshin23 commented Jul 10, 2022

This PR makes several changes in the struct/function/variable names to comply with JSO conventions. These changes include

  • InteriorPointSolver to MadNLPSolver
  • Logger to MadNLPLogger
  • Counters to MadNLPCounters
  • optimize! to solve!
  • ips to solver
  • ips.l to ips.y

@sshin23 sshin23 linked an issue Jul 10, 2022 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Jul 11, 2022

Codecov Report

Merging #194 (e43e15b) into master (03d728e) will increase coverage by 2.94%.
The diff coverage is 91.99%.

@@            Coverage Diff             @@
##           master     #194      +/-   ##
==========================================
+ Coverage   72.78%   75.72%   +2.94%     
==========================================
  Files          38       37       -1     
  Lines        3424     3468      +44     
==========================================
+ Hits         2492     2626     +134     
+ Misses        932      842      -90     
Impacted Files Coverage Δ
lib/MadNLPKrylov/src/MadNLPKrylov.jl 0.00% <0.00%> (ø)
lib/MadNLPPardiso/src/MadNLPPardiso.jl 100.00% <ø> (ø)
lib/MadNLPPardiso/src/pardiso.jl 0.00% <0.00%> (ø)
src/KKT/KKTsystem.jl 97.29% <ø> (ø)
src/LinearSolvers/backsolve.jl 100.00% <ø> (ø)
src/LinearSolvers/linearsolvers.jl 0.00% <0.00%> (ø)
src/MadNLP.jl 60.00% <ø> (-2.50%) ⬇️
src/options.jl 85.71% <ø> (ø)
src/Interfaces/MOI_interface.jl 71.74% <75.00%> (ø)
src/utils.jl 68.42% <75.00%> (ø)
... and 25 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f718b56...e43e15b. Read the comment docs.

@sshin23 sshin23 requested a review from frapac July 11, 2022 15:07
Copy link
Member

@frapac frapac left a comment

Choose a reason for hiding this comment

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

To me, the renaming makes a lot of sense. I just have a doubt for solve!, I think I still prefer optimize!. The reasons are:

  • the words optimize conveys more meaning than just solve (mathematics is all about solving equations, whereas optimizing is more context specific).
  • JuMP/MOI are both using optimize!

But I am open to any counter argument!

@sshin23
Copy link
Member Author

sshin23 commented Jul 11, 2022

@frapac, the goal of using solve! is to import SolverCore.solve! later. In that way, one can implement a unified solver interface for solvers (e.g., in BlockNLPModels.jl)

@frapac
Copy link
Member

frapac commented Jul 11, 2022

I see. And how about doing?

function solve!(::MadNLPSolver, nlp::AbstractNLPProblem)
     solver = MadNLPSolver(nlp)
     MadNLP.optimize!(solver)
end

I don't have any strong opinion about this too. My main concern is to have an easy interface if we have to re-solve the problem.

@sshin23
Copy link
Member Author

sshin23 commented Jul 11, 2022

@frapac the current solve! allows efficient resolve, but I see your point. Then optimize! will be an internal function that doesn't require the second argument nlp. I think that might actually be better because the JSO convention for solve! requires the second argument nlp

@frapac
Copy link
Member

frapac commented Jul 11, 2022

My other concern is that the API in SolversCore.jl is not fixed yet, with a PR opened since Mar 29, 2021. I think we should expect some changes in the naming on their side too, at least till the PR is not merged.

@sshin23
Copy link
Member Author

sshin23 commented Jul 12, 2022

@frapac Good point. I think we can hold until this PR gets merged
JuliaSmoothOptimizers/SolverCore.jl#26

Copy link
Member

@frapac frapac left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@sshin23 sshin23 merged commit 22b1f99 into master Aug 18, 2022
@frapac frapac deleted the ss/names branch April 10, 2024 12:24
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.

Change function names
3 participants