Describe the bug 🐞
I'm not sure if this is intended, but the prob field in OptimizationProblems hold the OptimizationCache, if the algorithm is one that supports caches.
Expected behavior
I would expect that calling sol.prob I would get the original OptimizationProblem back.
As it is, it's almost impossible to get the original problem from the solution. OptimizationCache stores versions of the constraint functions with p fixed. Concretely, this makes OptimizationAdjoint have to look inside of the closure made when p is fixed in the OptimizationCache, which is very brittle.
Describe the bug 🐞
I'm not sure if this is intended, but the
probfield in OptimizationProblems hold theOptimizationCache, if the algorithm is one that supports caches.Expected behavior
I would expect that calling
sol.probI would get the original OptimizationProblem back.As it is, it's almost impossible to get the original problem from the solution. OptimizationCache stores versions of the constraint functions with
pfixed. Concretely, this makes OptimizationAdjoint have to look inside of the closure made whenpis fixed in the OptimizationCache, which is very brittle.