-
Notifications
You must be signed in to change notification settings - Fork 573
Fix no results returned when no discrete variables are present in MindtPy #3861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+507
−6
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
37de1cb
Fix no results returned when no discrete variables are present in Min…
Toflamus 4fb7eac
Integrate the test into existing tests
Toflamus 9f79251
Black the format
Toflamus 29a96be
Update pyomo/contrib/mindtpy/algorithm_base_class.py
Toflamus 44703d1
Update pyomo/contrib/mindtpy/algorithm_base_class.py
Toflamus c4c241b
Update pyomo/contrib/mindtpy/algorithm_base_class.py
Toflamus 601e089
update test_mindtpy_lp_nlp.py and delete test_mindtpy_no_discrete.py
Toflamus 048a075
deleted: pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py
Toflamus 6071149
Merge branch 'fix/mindtpy-fix' of https://github.com/Toflamus/pyomo i…
Toflamus 9311f4e
Apply suggestion from @tarikLG
Toflamus 58c0d75
Update pyomo/contrib/mindtpy/algorithm_base_class.py
Toflamus 8fbfe80
Update mirror helper
Toflamus 655e7f8
Delete the no_discrete test
Toflamus 33cf9d8
Build a separate test for changes
Toflamus cc1d813
Add copyright and black format for the new test file
Toflamus 8071acc
Update pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py
Toflamus a27827f
Update pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py
Toflamus a92cd27
Update pyomo/contrib/mindtpy/algorithm_base_class.py
Toflamus 925d9a8
Update pyomo/contrib/mindtpy/tests/test_mindtpy_no_discrete.py
Toflamus ef3bcfc
Merge pull request #1 from Toflamus/fix/mindtpy-fix
bernalde e964ac6
Black the format of pyomo/pyomo/contrib/mindtpy/algorithm_base_class.py
Toflamus 27a040a
Merge pull request #2 from Toflamus/fix/mindtpy-fix
bernalde fd70276
Merge branch 'main' into main
jsiirola 14110bd
Fix bound inference to only set primal bound, not dual bound
Toflamus 1a524b6
Merge pull request #4 from Toflamus/fix/mindtpy-fix
bernalde 1e64f38
Merge branch 'main' into main
bernalde 34608bc
Consolidate duplicate TerminationCondition imports in test_mindtpy_no…
bernalde afb8408
Apply black formatting to test_mindtpy_no_discrete.py
bernalde 1abf71a
Merge branch 'main' into main
jsiirola File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused about this: Isn't the results object from the solver already reporting whatever bounds it got? Why can't you just pass those through? If it's local, it should only have the primal bound, and not the dual bound, which is exactly what you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code does pass through bounds from the solver first (lines 385-391). The fallback logic here only activates when the solver doesn't provide bounds at all. This happens with NLP solvers like IPOPT, which never populate lower_bound or upper_bound in their results objects (you can confirm this in sol.py - the sol reader sets constraint/variable/objective counts but never sets bounds). So the fallback is necessary to infer the primal bound from the objective value when the solver reports optimal but provides no bound information at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, I think I was getting mixed up between old interfaces and new! This makes sense.