Re-introduce knitro context closure and export solver quantities#633
Open
Re-introduce knitro context closure and export solver quantities#633
Conversation
for more information, see https://pre-commit.ci
…into close_knitro_context
for more information, see https://pre-commit.ci
Collaborator
|
@finozzifa could you add a release note? |
Collaborator
Author
Done! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes # (if applicable).
Changes proposed in this Pull Request
The Knitro Python API stores in the knitro context object all quantities related to a problem optimization. The API is built in such a way that the quantities can be extracted with dedicated methods only from the knitro context.
In order to make the
linopyinterface more flexible and avoid to extract inlinopyall the relevant quantities, I exposed in PR #600 the knitro context and removed the lines that freed it once the optimization was completed (in fact when a knitro context is freed, all the information it contains is lost).This however proved to be problematic in terms of memory usage.
Therefore, in this PR, I am not exposing anymore the knitro context, I free the knitro context and compute the necessary quantities from within
linopyand export them as part of theResultobject.FYI @danielelerede-oet
Checklist
doc.doc/release_notes.rstof the upcoming release is included.