`NamedTuple(::OptimizationSolution)` should be defined
For what? I don't know the context here 😅
For collecting the results and merge with other attributes for example
MWE?
Most types don't have a NamedTuple function though? Is there a normal fallback just using fieldnames .=> getfield?
It's a naive use case like:
sol = solve(...)
chi2 = compute_chi2(sol, input)
return merge(sol, (; chi2))
Currently, one has to do workaround like:
sol = solve(...)
chi2 = compute_chi2(sol, input)
(; u, objective) = sol
return (; u, objective, chi2)
Is it common to add that to types? I'd assume we'd want to convert it to have all fields? In theory there's a canonical fieldnames .=> getfield that should just be defined in Base?