Skip to content

Resolve issues copying and pickling SolverResults#3597

Merged
blnicho merged 20 commits intoPyomo:mainfrom
jsiirola:deepcopy-results
May 13, 2025
Merged

Resolve issues copying and pickling SolverResults#3597
blnicho merged 20 commits intoPyomo:mainfrom
jsiirola:deepcopy-results

Conversation

@jsiirola
Copy link
Copy Markdown
Member

@jsiirola jsiirola commented May 6, 2025

Fixes #3594 .

Summary/Motivation:

#3594 pointed out that deepcopying a SolverResults object would corrupt the internal data structures. This PR overhauls that class (which has been effectively untouched for more than a decade) to:

  • update it to use Python 3.7+ standards (in particular, now relies on dict being implicitly ordered)
  • rework & simplify logic for creating, pickling, and deepcopying the class (mostly removed all the custom code that was just not necessary
  • make SolverResolts objects comparable
  • update testing to reduce reliance on the filesystem
  • remove unused/untested code

Changes proposed in this PR:

  • (see above)

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@blnicho blnicho requested review from blnicho and mrmundt May 6, 2025 18:49
@jsiirola jsiirola requested a review from mrmundt May 8, 2025 20:31
@blnicho blnicho merged commit 5bd2849 into Pyomo:main May 13, 2025
33 checks passed
@jsiirola jsiirola deleted the deepcopy-results branch June 13, 2025 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deepcopy of SolverResults duplicates keys

3 participants