Closed jonathanfischer97 closed 4 months ago
Attention: 6 lines
in your changes are missing coverage. Please review.
Comparison is base (
fedb001
) 8.69% compared to head (cf6caa2
) 8.68%.
Files | Patch % | Lines |
---|---|---|
...zationEvolutionary/src/OptimizationEvolutionary.jl | 0.00% | 6 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@Vaibhavdixit02 Agreed, just wanted to keep the changes limited for this PR. No problem!
Why did you close this @jonathanfischer97?
@Vaibhavdixit02 Oops, my bad, thought branch was merged. Still getting the hang of contributing to public repos!
OptimizationEvolutionary test failure looks real, can you take a look at it?
@Vaibhavdixit02 Will do!
@Vaibhavdixit02 Fixed the trace test, previous test was querying the trace of sol
which wasn't storing trace higher up in the testset. So now sol
is the solution from the solve testing the callback and trace functionality. Should pass now!
Thanks, this is great!
Checklist
Additional context
This PR improves compatibility with Evolutionary.jl
trace!
functionality. Specifically, Evolutionary.jl allows user-defined overloads oftrace!
in order to save other values during optimization, via an generic interface. This functionality is advertised within the Evolutionary.jl docs, seen here:When using OptimizationEvolutionary however, this functionality was broken. Previously, any user overloads of
trace!
would be dispatched in-place of the existing overload in OptimizationEvolutionary, allowing the possibility of"x"
not being saved and thus throwing an error during construction ofOptimizationState
.To fix this, I've instead replaced the previous overload with an overload of the internal
Evolutionary.trace!
function, which calls the exposedtrace!
function. This overload adds"x"
to the existing"time"
key which will always be saved, prior to calling user methods and regardless of their existence.The added test tests that
"x"
as well as example user-defined trace record key are present in the output, which passed.