Skip to content

Commit 64ba70d

Browse files
Merge pull request #249 from SciML/Vaibhavdixit02-patch-1
Check against `NelderMead` type not object for callback branching
2 parents 5eb8c06 + e18a987 commit 64ba70d

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GalacticOptim"
22
uuid = "a75be94c-b780-496d-a8a9-0878b188d577"
33
authors = ["Vaibhavdixit02 <[email protected]>"]
4-
version = "3.3.0"
4+
version = "3.3.1"
55

66
[deps]
77
ArrayInterfaceCore = "30b0a656-2188-435a-8636-2ec0e6a096e2"

lib/GalacticOptimJL/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GalacticOptimJL"
22
uuid = "9d3c5eb1-403b-401b-8c0f-c11105342e6b"
33
authors = ["Vaibhav Dixit <[email protected]> and contributors"]
4-
version = "0.1.0"
4+
version = "0.1.1"
55

66
[deps]
77
GalacticOptim = "a75be94c-b780-496d-a8a9-0878b188d577"

lib/GalacticOptimJL/src/GalacticOptimJL.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function ___solve(prob::OptimizationProblem, opt::Optim.AbstractOptimizer,
7575
cur, state = iterate(data)
7676

7777
function _cb(trace)
78-
cb_call = opt == Optim.NelderMead() ? callback(decompose_trace(trace).metadata["centroid"], x...) : callback(decompose_trace(trace).metadata["x"], x...)
78+
cb_call = opt isa Optim.NelderMead ? callback(decompose_trace(trace).metadata["centroid"], x...) : callback(decompose_trace(trace).metadata["x"], x...)
7979
if !(typeof(cb_call) <: Bool)
8080
error("The callback should return a boolean `halt` for whether to stop the optimization process.")
8181
end

lib/GalacticOptimJL/test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ using Test
1818
@test 10 * sol.minimum < l1
1919

2020
prob = OptimizationProblem(rosenbrock, x0, _p)
21-
sol = solve(prob, Optim.NelderMead())
21+
sol = solve(prob, Optim.NelderMead(;initial_simplex=Optim.AffineSimplexer(;a = 0.025, b = 0.5)))
2222
@test 10 * sol.minimum < l1
2323

2424
cons = (x, p) -> [x[1]^2 + x[2]^2]

0 commit comments

Comments
 (0)