Skip to content

sol.prob on an OptimizationSolution gives OptimizationCache instead of OptimizationProblem #1191

@jClugstor

Description

@jClugstor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions