Skip to content

Commit 4b63a5d

Browse files
committed
cleanup
1 parent eff11c4 commit 4b63a5d

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

lib/OptimizationGCMAES/src/OptimizationGCMAES.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,8 @@ function __map_optimizer_args(cache::OptimizationBase.OptimizationCache, opt::GC
4848
end
4949

5050
function SciMLBase.__init(prob::SciMLBase.OptimizationProblem,
51-
opt::GCMAESOpt; σ0 = 0.2,
52-
callback = (args...) -> (false),
53-
progress = false, kwargs...)
54-
return OptimizationCache(prob, opt; σ0 = σ0, callback = callback,
55-
progress = progress,
56-
kwargs...)
51+
opt::GCMAESOpt; σ0 = 0.2, kwargs...)
52+
return OptimizationCache(prob, opt; σ0 = σ0, kwargs...)
5753
end
5854

5955
function SciMLBase.__solve(cache::OptimizationCache{O}) where {O <: GCMAESOpt}

lib/OptimizationIpopt/src/OptimizationIpopt.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ function __map_optimizer_args(cache,
256256
)
257257

258258
# Set up progress callback
259-
progress_callback = IpoptProgressLogger(progress, callback, prob, cache.n, cache.num_cons, maxiters, cache.iterations)
259+
progress_callback = IpoptProgressLogger(
260+
progress, callback, prob, cache.n, cache.num_cons, maxiters, cache.iterations)
260261
intermediate = (args...) -> progress_callback(args...)
261262
Ipopt.SetIntermediateCallback(prob, intermediate)
262263

lib/OptimizationMadNLP/src/OptimizationMadNLP.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ function __map_optimizer_args(cache,
345345
nvar = length(cache.u0)
346346
ncon = !isnothing(cache.lcons) ? length(cache.lcons) : 0
347347

348-
if callback !== DEFAULT_CALLBACK || progress
348+
if !(callback isa OptimizationBase.NullCallback) || progress
349349
@warn("MadNLP doesn't currently support user defined callbacks.")
350350
end
351351
# TODO: add support for user callbacks in MadNLP
@@ -376,7 +376,7 @@ function __map_optimizer_args(cache,
376376
print_level = verbose
377377
end
378378

379-
!isnothing(reltol) && @warn "reltol not supported by MadNLP."
379+
!isnothing(reltol) && @warn "reltol not supported by MadNLP, use abstol instead."
380380
tol = isnothing(abstol) ? 1e-8 : abstol
381381
max_iter = isnothing(maxiters) ? 3000 : maxiters
382382
max_wall_time = isnothing(maxtime) ? 1e6 : maxtime

lib/OptimizationMadNLP/test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ using OptimizationMadNLP
22
using OptimizationBase
33
using MadNLP
44
using Test
5+
using ADTypes
56
import Zygote, ForwardDiff, ReverseDiff
67
using SparseArrays
78
using DifferentiationInterface: SecondOrder

0 commit comments

Comments
 (0)