Skip to content
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

Fixed issue #683: error when store_trace=true in OptimizationEvolutionary.jl #691

Merged
merged 8 commits into from
Feb 2, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
u = curr_u,
objective = x[1],
original = trace)
cb_call = cache.callback(opt_state, trace.value...)
cb_call = cache.callback(opt_state, decompose_trace(trace).value...)

Check warning on line 93 in lib/OptimizationEvolutionary/src/OptimizationEvolutionary.jl

View check run for this annotation

Codecov / codecov/patch

lib/OptimizationEvolutionary/src/OptimizationEvolutionary.jl#L93

Added line #L93 was not covered by tests
if !(cb_call isa Bool)
error("The callback should return a boolean `halt` for whether to stop the optimization process.")
end
Expand Down
3 changes: 3 additions & 0 deletions lib/OptimizationEvolutionary/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ Random.seed!(1234)
return false
end
sol = solve(prob, CMAES(μ = 40, λ = 100), callback = cb, maxiters = 100)

#test that `store_trace=true` works now. Threw ""type Array has no field value" before.
solve(prob, CMAES(μ = 40, λ = 100), store_trace = true)
end
Loading