-
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
Update Gurobi license checks in tests #3011
Conversation
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 couple questions, but otherwise this looks good!
try: | ||
with capture_output(): | ||
self.solve(m) | ||
return m.x.value == 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.
Is there any risk this does the wrong thing if x
isn't exactly 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.
There is a risk, but this is such a simple problem that Gurobi should solve it exactly in presolve.
@@ -22,6 +22,7 @@ | |||
except ImportError: | |||
gurobipy_available = False | |||
|
|||
gurobi_available = GurobiDirect().available(exception_flag=False) |
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.
Does this one check the license when you ask about availability? Because if not the changes in this file don't make sense to me.
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.
Yes. gurobipy_available
only checks that the gurobipy python module is importable. The gurobi_available
test checks the license.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3011 +/- ##
==========================================
- Coverage 88.08% 88.07% -0.02%
==========================================
Files 768 768
Lines 89410 89425 +15
==========================================
+ Hits 78759 78760 +1
- Misses 10651 10665 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Fixes # .
Summary/Motivation:
This resolves test failures that occur when Gurobi is installed, but not properly licensed.
Changes proposed in this PR:
license_is_valid()
method to enable license checks for the Gurobi NL interface.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: