Closed jonathanfischer97 closed 2 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 63.85%. Comparing base (
e0610cd
) to head (e2cad3d
). Report is 15 commits behind head on master.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
No worries, this makes sense
Regarding my previous PRs #702 and #732, I think they were mistaken because of my own unclear thinking about why
dt["x"]
needed to be saved via the defaultEvolutionary.trace!
overload.I was operating from the perspective of my own uncommon workflow, where I accumulate "feasible" optimization solutions with each iteration, so I overload the
trace!
to save deep copies of all these feasible solutions, so that the trace acts as a permanent record.However, this is likely much different from the typical use case, where only the most recent
OptimizationState
is relevant for any user-injected callback. So a reference tocurr_u
as it is used in the callback interface_cb
is fine, and in-fact preferred in most cases to minimize memory footprint.Therefore, I have changed the
Evolutionary.trace!
overload to just save a reference the last element of the population, under the key "curr_u
", in line with how the trace was previously being accessed within_cb
. This also clarifies the code by making the reason for thetrace!
overload more transparent.Any further trace functionality that a user might need, like in my own use case, should be left for the user to define via
trace!
overload. This keeps this package and its default settings tailored to the typical use case.Apologies, should have thought more carefully before making the previous PRs.