-
Notifications
You must be signed in to change notification settings - Fork 557
Separate solver_available
and license_available
#3730
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
Open
mrmundt
wants to merge
12
commits into
Pyomo:main
Choose a base branch
from
mrmundt:available-license
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+727
−189
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f76547b
Separate available and license_available
mrmundt 6d18061
Add some availability tests
mrmundt 8139343
Clean up some docs
mrmundt 9ada68a
Simplify the license check
mrmundt ebfc130
Rework to solver_available, license_available, and available
mrmundt 69d7afe
Direct license check no longer necessary
mrmundt e13e10f
Update tests to ensure correct behavior; actually add minimal gurobi_…
mrmundt 190bf09
Missed a docstring update
mrmundt 799739d
Look, the tests caught a bug
mrmundt ccab516
Add log message if timeout achieved; set LicenseAvailability explicitly
mrmundt 6fc3fcb
Fix docstrings
mrmundt 0c57d1a
Address michaelbynum's comments
mrmundt 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# ___________________________________________________________________________ | ||
# | ||
# Pyomo: Python Optimization Modeling Objects | ||
# Copyright (c) 2008-2025 | ||
# National Technology and Engineering Solutions of Sandia, LLC | ||
# Under the terms of Contract DE-NA0003525 with National Technology and | ||
# Engineering Solutions of Sandia, LLC, the U.S. Government retains certain | ||
# rights in this software. | ||
# This software is distributed under the 3-clause BSD License. | ||
# ___________________________________________________________________________ | ||
|
||
from pyomo.common.enums import IntEnum | ||
|
||
|
||
class SolverAvailability(IntEnum): | ||
""" | ||
Class to capture different statuses in which a solver can exist in | ||
order to record its availability for use. | ||
""" | ||
|
||
Available = 1 | ||
NotFound = 0 | ||
BadVersion = -1 | ||
NeedsCompiledExtension = -2 | ||
|
||
def __bool__(self): | ||
return self._value_ > 0 | ||
|
||
def __format__(self, format_spec): | ||
return format(self.name, format_spec) | ||
|
||
def __str__(self): | ||
return self.name | ||
|
||
|
||
class LicenseAvailability(IntEnum): | ||
""" | ||
Runtime status for licensing. Independent from | ||
overall solver availability. A return value > 0 is "usable in some form". | ||
""" | ||
|
||
FullLicense = 3 | ||
LimitedLicense = 2 | ||
NotApplicable = 1 | ||
NotAvailable = 0 | ||
BadLicense = -1 | ||
Timeout = -2 | ||
Unknown = -3 | ||
|
||
def __bool__(self): | ||
return self._value_ > 0 | ||
|
||
def __format__(self, format_spec): | ||
return format(self.name, format_spec) | ||
|
||
def __str__(self): | ||
return self.name |
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.
Uh oh!
There was an error while loading. Please reload this page.