-
Notifications
You must be signed in to change notification settings - Fork 526
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
Fix MindtPy bugs #3034
Fix MindtPy bugs #3034
Conversation
This is waiting for #2988 to be merged first |
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.
A few comments and questions. I also think it would be good to add tests for the bugs you are addressing in this PR.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3034 +/- ##
==========================================
+ Coverage 88.29% 88.32% +0.03%
==========================================
Files 832 832
Lines 92234 92253 +19
==========================================
+ Hits 81438 81484 +46
+ Misses 10796 10769 -27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
The |
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.
A few questions, but overall this looks good. Thanks for the added tests!
@@ -1 +1 @@ | |||
__version__ = (0, 1, 0) | |||
__version__ = (1, 0, 0) |
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.
Should your changelog in line 54 of Mindtpy.py
match this version number?
except KeyError as e: | ||
self.config.logger.error(str(e) + '\nDeactivating no-good cuts failed.') | ||
self.config.logger.error(e, exc_info=True) | ||
self.config.logger.error('Deactivating no-good cuts failed.') |
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.
How can this fail? Wouldn't this be a DeveloperError
(if you need an error here at all) since mindtpy can keep track of what cuts it has added?
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.
Thanks for pointing this out. I checked the log of the benchmark tests and found this error came out when timelimit
was reached. Let me try to fix it before merging this PR. Thanks.
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 KeyError
happens when no feasible solution has been found within the timelimit
. I added one more condition for the fix_dual_bound
function in the OA, GOA, LP/NLP B&B and GLP/NLP B&B methods.
I also removed fix_dual_bound
for the ECP method since we will never add no-good cuts in the ECP method.
I would appreciate it if @bernalde can give it a double-check.
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.
Ah, okay. I think a different error message might be clearer then--it's not deactivating the cuts that failed, it's the solve after you deactivated them (if I'm understanding correctly).
I have already run the black format locally. Are there any new requirements for the black format?
|
@ZedongPeng - check your black version. They released an update this month that made some changes. |
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.
@ZedongPeng I have a couple minor edits but otherwise I think this looks good.
Co-authored-by: Bethany Nicholson <blnicho@users.noreply.github.com>
Co-authored-by: Bethany Nicholson <blnicho@users.noreply.github.com>
Fixes # .
Summary/Motivation:
This PR fixes several bugs in MindtPy according to the benchmark results.
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: