Skip to content

Commit 2db67d8

Browse files
committed
Implement api_version on the legacy wrapper classes for contrib.solver and appsi
1 parent d7559ff commit 2db67d8

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

pyomo/contrib/appsi/base.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,18 @@ def __enter__(self):
16861686
def __exit__(self, t, v, traceback):
16871687
pass
16881688

1689+
@classmethod
1690+
def api_version(self):
1691+
"""
1692+
Return the public API supported by this interface.
1693+
1694+
Returns
1695+
-------
1696+
~pyomo.common.enums.SolverAPIVersion
1697+
A solver API enum object
1698+
"""
1699+
return SolverAPIVersion.V1
1700+
16891701

16901702
class SolverFactoryClass(Factory):
16911703
def register(self, name, doc=None):

pyomo/contrib/solver/common/base.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -744,3 +744,15 @@ def warm_start_capable(self):
744744

745745
def default_variable_value(self):
746746
return None
747+
748+
@classmethod
749+
def api_version(self):
750+
"""
751+
Return the public API supported by this interface.
752+
753+
Returns
754+
-------
755+
~pyomo.common.enums.SolverAPIVersion
756+
A solver API enum object
757+
"""
758+
return SolverAPIVersion.V1

0 commit comments

Comments
 (0)