Skip to content

Commit 34b15d8

Browse files
authored
Merge pull request #3165 from MAiNGO-github/maingo_interface
Added MAiNGO appsi-interface
2 parents f8459a7 + fbd9a0a commit 34b15d8

File tree

10 files changed

+1024
-107
lines changed

10 files changed

+1024
-107
lines changed

.github/workflows/test_branches.yml

+2
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ jobs:
268268
|| echo "WARNING: Gurobi is not available"
269269
python -m pip install --cache-dir cache/pip xpress \
270270
|| echo "WARNING: Xpress Community Edition is not available"
271+
python -m pip install --cache-dir cache/pip maingopy \
272+
|| echo "WARNING: MAiNGO is not available"
271273
if [[ ${{matrix.python}} == pypy* ]]; then
272274
echo "skipping wntr for pypy"
273275
else

.github/workflows/test_pr_and_main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ jobs:
305305
|| echo "WARNING: Gurobi is not available"
306306
python -m pip install --cache-dir cache/pip xpress \
307307
|| echo "WARNING: Xpress Community Edition is not available"
308+
python -m pip install --cache-dir cache/pip maingopy \
309+
|| echo "WARNING: MAiNGO is not available"
308310
if [[ ${{matrix.python}} == pypy* ]]; then
309311
echo "skipping wntr for pypy"
310312
else
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
MAiNGO
2+
======
3+
4+
.. autoclass:: pyomo.contrib.appsi.solvers.maingo.MAiNGOConfig
5+
:members:
6+
:inherited-members:
7+
:undoc-members:
8+
:show-inheritance:
9+
10+
.. autoclass:: pyomo.contrib.appsi.solvers.maingo.MAiNGO
11+
:members:
12+
:inherited-members:
13+
:undoc-members:
14+
:show-inheritance:

doc/OnlineDocs/library_reference/appsi/appsi.solvers.rst

+1
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ Solvers
1313
appsi.solvers.cplex
1414
appsi.solvers.cbc
1515
appsi.solvers.highs
16+
appsi.solvers.maingo

pyomo/contrib/appsi/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1661,15 +1661,15 @@ def license_is_valid(self) -> bool:
16611661

16621662
@property
16631663
def options(self):
1664-
for solver_name in ['gurobi', 'ipopt', 'cplex', 'cbc', 'highs']:
1664+
for solver_name in ['gurobi', 'ipopt', 'cplex', 'cbc', 'highs', 'maingo']:
16651665
if hasattr(self, solver_name + '_options'):
16661666
return getattr(self, solver_name + '_options')
16671667
raise NotImplementedError('Could not find the correct options')
16681668

16691669
@options.setter
16701670
def options(self, val):
16711671
found = False
1672-
for solver_name in ['gurobi', 'ipopt', 'cplex', 'cbc', 'highs']:
1672+
for solver_name in ['gurobi', 'ipopt', 'cplex', 'cbc', 'highs', 'maingo']:
16731673
if hasattr(self, solver_name + '_options'):
16741674
setattr(self, solver_name + '_options', val)
16751675
found = True

pyomo/contrib/appsi/plugins.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from pyomo.common.extensions import ExtensionBuilderFactory
1313
from .base import SolverFactory
14-
from .solvers import Gurobi, Ipopt, Cbc, Cplex, Highs
14+
from .solvers import Gurobi, Ipopt, Cbc, Cplex, Highs, MAiNGO
1515
from .build import AppsiBuilder
1616

1717

@@ -30,3 +30,6 @@ def load():
3030
SolverFactory.register(name='highs', doc='Automated persistent interface to Highs')(
3131
Highs
3232
)
33+
SolverFactory.register(
34+
name='maingo', doc='Automated persistent interface to MAiNGO'
35+
)(MAiNGO)

pyomo/contrib/appsi/solvers/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
from .cplex import Cplex
1616
from .highs import Highs
1717
from .wntr import Wntr, WntrResults
18+
from .maingo import MAiNGO

0 commit comments

Comments
 (0)