Skip to content

Commit 582ab3c

Browse files
committed
clean
Fix NLS symbol issue remove CaNNOLeS in compat
1 parent fc1e87c commit 582ab3c

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

Project.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,17 @@ SolverBenchmarkExt = ["SolverBenchmark"]
4242

4343
[compat]
4444
ADNLPModels = "0.4, 0.5, 0.6, 0.7"
45-
CaNNOLeS = "0.7"
4645
DataFrames = "1"
47-
FletcherPenaltySolver = "0.2"
4846
JSOSolvers = "0.10, 0.11"
4947
JuMP = "1"
5048
KNITRO = "0.13.0"
5149
LLSModels = "0.3.6"
5250
LinearOperators = "2"
5351
NLPModels = "0.19, 0.20"
54-
NLPModelsIpopt = "0.10"
5552
NLPModelsJuMP = "0.11, 0.12"
5653
NLPModelsKnitro = "0.7"
5754
NLPModelsModifiers = "0.6.2"
5855
Percival = "0.6, 0.7"
5956
QuadraticModels = "0.9.2"
60-
RipQP = "0.5, 0.6"
61-
SolverBenchmark = "0.5"
6257
SolverCore = "0.3"
6358
julia = "^1.6.0"

src/JSOSuite.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ push!(
143143
push!(
144144
optimizers,
145145
(
146-
"TRON-NLS",
146+
"TRONNLS",
147147
:TronSolverNLS,
148148
"JSOSolvers.jl",
149149
:tron,
@@ -161,7 +161,7 @@ push!(
161161
push!(
162162
optimizers,
163163
(
164-
"TRUNK-NLS",
164+
"TRUNKNLS",
165165
:TrunkSolverNLS,
166166
"JSOSolvers.jl",
167167
:trunk,
@@ -297,7 +297,14 @@ Return `true` if the solver `name` is available.
297297
is_available(name::String) = is_available(Symbol(name))
298298
is_available(name::Symbol) = is_available(Val(name))
299299

300-
is_available(::Val{name}) where {name} = true
300+
is_available(::Val{name}) where {name} = false
301+
is_available(::Val{:R2}) = true
302+
is_available(::Val{:LBFGS}) = true
303+
is_available(::Val{:TRON}) = true
304+
is_available(::Val{:TRUNK}) = true
305+
is_available(::Val{:TRONNLS}) = true
306+
is_available(::Val{:TRUNKNLS}) = true
307+
is_available(::Val{:Percival}) = true
301308
is_available(::Val{:CaNNOLeS}) = !isnothing(Base.get_extension(JSOSuite, :CaNNOLeSExt))
302309
is_available(::Val{:DCISolver}) = !isnothing(Base.get_extension(JSOSuite, :DCISolverExt))
303310
is_available(::Val{:FletcherPenaltySolver}) = !isnothing(Base.get_extension(JSOSuite, :FletcherPenaltySolverExt))

src/selection.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ Algorithm selection:
5252
- nonlinear objective: ✓;
5353
- may use 2-th order derivative.
5454
There are 7 optimizers available:
55-
["LBFGS", "R2", "TRON", "TRUNK", "TRON-NLS", "TRUNK-NLS", "Percival"].
56-
["LBFGS", "R2", "TRON", "TRUNK", "TRON-NLS", "TRUNK-NLS", "Percival"]
55+
["LBFGS", "R2", "TRON", "TRUNK", "TRONNLS", "TRUNKNLS", "Percival"].
56+
["LBFGS", "R2", "TRON", "TRUNK", "TRONNLS", "TRUNKNLS", "Percival"]
5757
```
5858
"""
5959
function select_optimizers(

test/runtests.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,20 @@ end
6161
nlp = OptimizationProblems.ADNLPProblems.arglina()
6262
model = OptimizationProblems.PureJuMP.arglina()
6363
@testset "Test $solver_name" for solver_name in JSOSuite.optimizers[!, :name_solver]
64+
name = JSOSuite.optimizers[JSOSuite.optimizers.name_solver .== solver_name, :name][1]
6465
solver_name == :DCIWorkspace && continue
6566
solver_name == :RipQPSolver && continue
6667
can_solve_nlp =
6768
JSOSuite.optimizers[JSOSuite.optimizers.name_solver .== solver_name, :can_solve_nlp]
6869
spec_nls =
6970
JSOSuite.optimizers[JSOSuite.optimizers.name_solver .== solver_name, :specialized_nls]
70-
if is_available(solver_name) && can_solve_nlp[1]
71+
if is_available(name) && can_solve_nlp[1]
7172
test_in_place_solve(nlp, solver_name)
7273
test_in_place_solve(model, solver_name)
73-
elseif is_available(solver_name) && spec_nls[1] # NLS
74+
elseif is_available(name) && spec_nls[1] # NLS
7475
nls = OptimizationProblems.ADNLPProblems.arglina(use_nls = true)
7576
test_in_place_solve(nls, solver_name)
76-
elseif is_available(solver_name) # RipQP
77+
elseif is_available(name) # RipQP
7778
nlp_qm = QuadraticModel(nlp, nlp.meta.x0)
7879
test_in_place_solve(nlp_qm, solver_name)
7980
end
@@ -112,10 +113,8 @@ end
112113
OptimizationProblems.ADNLPProblems.eval(Meta.parse(problem))() for
113114
problem meta[(5 .<= meta.nvar .<= 10) .& (meta.ncon .== 0) .& (.!meta.has_bounds), :name]
114115
]
115-
select = JSOSuite.optimizers[
116-
JSOSuite.optimizers.can_solve_nlp .& JSOSuite.optimizers.is_available,
117-
:name,
118-
]
116+
select = is_available(JSOSuite.optimizers)
117+
select = select[JSOSuite.optimizers.can_solve_nlp, :name]
119118
stats = bmark_solvers(ad_problems, select, atol = 1e-3, max_time = 10.0, verbose = 0)
120119
@test true # just test that it runs
121120
end
@@ -158,7 +157,7 @@ for solver in eachrow(JSOSuite.optimizers)
158157
nlp = mgh17()
159158
@testset "Test options in $(solver.name)" begin
160159
# We just test that the solver runs with the options
161-
if solver.is_available
160+
if is_available(solver.name)
162161
if solver.nonlinear_obj
163162
minimize(
164163
solver.name,
@@ -193,7 +192,7 @@ end
193192
callback = (args...) -> nothing
194193
for solver in eachrow(JSOSuite.optimizers)
195194
@testset "Test options in $(solver.name)" begin
196-
solver.is_available || continue
195+
is_available(solver.name) || continue
197196
((nlp.meta.ncon > 0) && (!solver.equalities)) && continue
198197
# We just test that the solver runs with the options
199198
if solver.can_solve_nlp

0 commit comments

Comments
 (0)