Skip to content

Commit

Permalink
Make default solver_io None, add check for available
Browse files Browse the repository at this point in the history
  • Loading branch information
gseastream committed Aug 8, 2018
1 parent 1e795ea commit 50db1e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyomo/network/decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def __init__(self, **kwds):
options["accel_min"] = -5
options["accel_max"] = 0
options["tear_solver"] = "cplex"
options["tear_solver_io"] = "python"
options["tear_solver_io"] = None
options["tear_solver_options"] = {}

options.update(kwds)
Expand Down Expand Up @@ -666,6 +666,9 @@ def select_tear_mip(self, G, solver, solver_io=None, solver_options={}):

from pyomo.environ import SolverFactory
opt = SolverFactory(solver, solver_io=solver_io)
if not opt.available(exception_flag=False):
raise ValueError("Solver '%s' (solver_io=%r) is not available, please pass a "
"different solver" % (solver, solver_io))
opt.solve(model, **solver_options)

# collect final list by adding every edge with a "True" binary var
Expand Down

0 comments on commit 50db1e2

Please sign in to comment.