Skip to content

Commit c463632

Browse files
authored
Merge pull request Pyomo#3384 from jsiirola/gurobi-sh-deprecation
Move away from dependence on gurobi.sh
2 parents 22a1dac + f28d7e6 commit c463632

File tree

6 files changed

+341
-94
lines changed

6 files changed

+341
-94
lines changed

pyomo/common/unittest.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -876,10 +876,11 @@ def filter_fcn(self, line):
876876
# next 6 patterns ignore entries in pstats reports:
877877
'function calls',
878878
'List reduced',
879-
'.py:',
879+
'.py:', # timing/profiling output
880880
' {built-in method',
881881
' {method',
882882
' {pyomo.core.expr.numvalue.as_numeric}',
883+
' {gurobipy.',
883884
):
884885
if field in line:
885886
return True

pyomo/gdp/plugins/multiple_bigm.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@
7272
}
7373

7474

75+
def Solver(val):
76+
if isinstance(val, str):
77+
return SolverFactory(val)
78+
if not hasattr(val, 'solve'):
79+
raise ValueError("Expected a string or solver object (with solve() method)")
80+
return val
81+
82+
7583
@TransformationFactory.register(
7684
'gdp.mbigm',
7785
doc="Relax disjunctive model using big-M terms specific to each disjunct",
@@ -127,7 +135,8 @@ class MultipleBigMTransformation(GDP_to_MIP_Transformation, _BigM_MixIn):
127135
CONFIG.declare(
128136
'solver',
129137
ConfigValue(
130-
default=SolverFactory('gurobi'),
138+
default='gurobi',
139+
domain=Solver,
131140
description="A solver to use to solve the continuous subproblems for "
132141
"calculating the M values",
133142
),

0 commit comments

Comments
 (0)