Skip to content

Commit a2ed16c

Browse files
authoredFeb 2, 2024··
Merge pull request #691 from jonathanfischer97/master
Fixed issue #683: error when `store_trace=true` in OptimizationEvolutionary.jl
2 parents d879158 + 661bcf5 commit a2ed16c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

‎lib/OptimizationEvolutionary/src/OptimizationEvolutionary.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function SciMLBase.__solve(cache::OptimizationCache{
9090
u = curr_u,
9191
objective = x[1],
9292
original = trace)
93-
cb_call = cache.callback(opt_state, trace.value...)
93+
cb_call = cache.callback(opt_state, decompose_trace(trace).value...)
9494
if !(cb_call isa Bool)
9595
error("The callback should return a boolean `halt` for whether to stop the optimization process.")
9696
end

‎lib/OptimizationEvolutionary/test/runtests.jl

+3
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,7 @@ Random.seed!(1234)
4242
return false
4343
end
4444
sol = solve(prob, CMAES= 40, λ = 100), callback = cb, maxiters = 100)
45+
46+
#test that `store_trace=true` works now. Threw ""type Array has no field value" before.
47+
solve(prob, CMAES= 40, λ = 100), store_trace = true)
4548
end

0 commit comments

Comments
 (0)
Please sign in to comment.