Skip to content

Commit

Permalink
Minor edit to APPSI Highs version method to support older versions of…
Browse files Browse the repository at this point in the history
… Highs
  • Loading branch information
blnicho committed May 6, 2024
1 parent 6b1e296 commit 3165c9d
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions pyomo/contrib/appsi/solvers/highs.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,23 @@ def available(self):
return self.Availability.NotFound

def version(self):
version = (
highspy.HIGHS_VERSION_MAJOR,
highspy.HIGHS_VERSION_MINOR,
highspy.HIGHS_VERSION_PATCH,
)
try:
version = (
highspy.HIGHS_VERSION_MAJOR,
highspy.HIGHS_VERSION_MINOR,
highspy.HIGHS_VERSION_PATCH,
)
except AttributeError:
# Older versions of Highs do not have the above attributes
# and the solver version can only be obtained by making
# an instance of the solver class.
tmp = highspy.Highs()
version = (
tmp.versionMajor(),
tmp.versionMinor(),
tmp.versionPatch(),
)

return version

@property
Expand Down

0 comments on commit 3165c9d

Please sign in to comment.