@@ -40,17 +40,20 @@ with existing interfaces).
40
40
:header-rows: 1
41
41
42
42
* - Solver
43
- - Name registered in the |br | ``pyomo.contrib.solver.factory.SolverFactory ``
43
+ - Name registered in the |br | ``pyomo.contrib.solver.common. factory.SolverFactory ``
44
44
- Name registered in the |br | ``pyomo.opt.base.solvers.LegacySolverFactory ``
45
45
* - Ipopt
46
46
- ``ipopt ``
47
47
- ``ipopt_v2 ``
48
48
* - Gurobi (persistent)
49
- - ``gurobi ``
50
- - ``gurobi_v2 ``
49
+ - ``gurobi_persistent ``
50
+ - ``gurobi_persistent_v2 ``
51
51
* - Gurobi (direct)
52
52
- ``gurobi_direct ``
53
53
- ``gurobi_direct_v2 ``
54
+ * - HiGHS
55
+ - ``highs ``
56
+ - ``highs ``
54
57
55
58
Using the new interfaces through the legacy interface
56
59
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -64,7 +67,6 @@ be used with other Pyomo tools / capabilities.
64
67
:skipif: not ipopt_available
65
68
66
69
import pyomo.environ as pyo
67
- from pyomo.contrib.solver.util import assert_optimal_termination
68
70
69
71
model = pyo.ConcreteModel()
70
72
model.x = pyo.Var(initialize=1.5)
@@ -76,13 +78,14 @@ be used with other Pyomo tools / capabilities.
76
78
model.obj = pyo.Objective(rule=rosenbrock, sense=pyo.minimize)
77
79
78
80
status = pyo.SolverFactory('ipopt_v2').solve(model)
79
- assert_optimal_termination(status)
81
+ pyo. assert_optimal_termination(status)
80
82
model.pprint()
81
83
82
84
.. testoutput ::
83
85
:skipif: not ipopt_available
84
86
:hide:
85
87
88
+ ...
86
89
2 Var Declarations
87
90
...
88
91
3 Declarations: x y obj
@@ -114,6 +117,7 @@ future methods of specifying solver options are supported:
114
117
:skipif: not ipopt_available
115
118
:hide:
116
119
120
+ ...
117
121
2 Var Declarations
118
122
...
119
123
3 Declarations: x y obj
@@ -128,8 +132,7 @@ Here we use the new interface by importing it directly:
128
132
129
133
# Direct import
130
134
import pyomo.environ as pyo
131
- from pyomo.contrib.solver.util import assert_optimal_termination
132
- from pyomo.contrib.solver.ipopt import Ipopt
135
+ from pyomo.contrib.solver.solvers.ipopt import Ipopt
133
136
134
137
model = pyo.ConcreteModel()
135
138
model.x = pyo.Var(initialize=1.5)
@@ -142,7 +145,7 @@ Here we use the new interface by importing it directly:
142
145
143
146
opt = Ipopt()
144
147
status = opt.solve(model)
145
- assert_optimal_termination(status)
148
+ pyo. assert_optimal_termination(status)
146
149
# Displays important results information; only available through the new interfaces
147
150
status.display()
148
151
model.pprint()
@@ -165,8 +168,7 @@ Here we use the new interface by retrieving it from the new ``SolverFactory``:
165
168
166
169
# Import through new SolverFactory
167
170
import pyomo.environ as pyo
168
- from pyomo.contrib.solver.util import assert_optimal_termination
169
- from pyomo.contrib.solver.factory import SolverFactory
171
+ from pyomo.contrib.solver.common.factory import SolverFactory
170
172
171
173
model = pyo.ConcreteModel()
172
174
model.x = pyo.Var(initialize=1.5)
@@ -179,7 +181,7 @@ Here we use the new interface by retrieving it from the new ``SolverFactory``:
179
181
180
182
opt = SolverFactory('ipopt')
181
183
status = opt.solve(model)
182
- assert_optimal_termination(status)
184
+ pyo. assert_optimal_termination(status)
183
185
# Displays important results information; only available through the new interfaces
184
186
status.display()
185
187
model.pprint()
@@ -204,7 +206,6 @@ replace the existing (legacy) SolverFactory and utilities with the new
204
206
205
207
# Change default SolverFactory version
206
208
import pyomo.environ as pyo
207
- from pyomo.contrib.solver.util import assert_optimal_termination
208
209
from pyomo.__future__ import solver_factory_v3
209
210
210
211
model = pyo.ConcreteModel()
@@ -217,7 +218,7 @@ replace the existing (legacy) SolverFactory and utilities with the new
217
218
model.obj = pyo.Objective(rule=rosenbrock, sense=pyo.minimize)
218
219
219
220
status = pyo.SolverFactory('ipopt').solve(model)
220
- assert_optimal_termination(status)
221
+ pyo. assert_optimal_termination(status)
221
222
# Displays important results information; only available through the new interfaces
222
223
status.display()
223
224
model.pprint()
@@ -245,13 +246,13 @@ recently incorporated into the redesigned NL writer. For example, you
245
246
can control the NL writer in the new ``ipopt `` interface through the
246
247
solver's ``writer_config `` configuration option:
247
248
248
- .. autoclass :: pyomo.contrib.solver.ipopt.Ipopt
249
+ .. autoclass :: pyomo.contrib.solver.solvers. ipopt.Ipopt
249
250
:noindex:
250
251
:members: solve
251
252
252
253
.. testcode ::
253
254
254
- from pyomo.contrib.solver.ipopt import Ipopt
255
+ from pyomo.contrib.solver.solvers. ipopt import Ipopt
255
256
opt = Ipopt()
256
257
opt.config.writer_config.display()
257
258
@@ -281,18 +282,18 @@ Interface Implementation
281
282
------------------------
282
283
283
284
All new interfaces should be built upon one of two classes (currently):
284
- :class: `SolverBase<pyomo.contrib.solver.base.SolverBase> ` or
285
- :class: `PersistentSolverBase<pyomo.contrib.solver.base.PersistentSolverBase> `.
285
+ :class: `SolverBase<pyomo.contrib.solver.common. base.SolverBase> ` or
286
+ :class: `PersistentSolverBase<pyomo.contrib.solver.common. base.PersistentSolverBase> `.
286
287
287
288
All solvers should have the following:
288
289
289
- .. autoclass :: pyomo.contrib.solver.base.SolverBase
290
+ .. autoclass :: pyomo.contrib.solver.common. base.SolverBase
290
291
:noindex:
291
292
:members:
292
293
293
294
Persistent solvers include additional members as well as other configuration options:
294
295
295
- .. autoclass :: pyomo.contrib.solver.base.PersistentSolverBase
296
+ .. autoclass :: pyomo.contrib.solver.common. base.PersistentSolverBase
296
297
:noindex:
297
298
:show-inheritance:
298
299
:members:
@@ -301,12 +302,12 @@ Results
301
302
-------
302
303
303
304
Every solver, at the end of a
304
- :meth: `solve<pyomo.contrib.solver.base.SolverBase.solve> ` call, will
305
- return a :class: `Results<pyomo.contrib.solver.results.Results> `
305
+ :meth: `solve<pyomo.contrib.solver.common. base.SolverBase.solve> ` call, will
306
+ return a :class: `Results<pyomo.contrib.solver.common. results.Results> `
306
307
object. This object is a :py:class: `pyomo.common.config.ConfigDict `,
307
308
which can be manipulated similar to a standard ``dict `` in Python.
308
309
309
- .. autoclass :: pyomo.contrib.solver.results.Results
310
+ .. autoclass :: pyomo.contrib.solver.common. results.Results
310
311
:noindex:
311
312
:show-inheritance:
312
313
:members:
@@ -318,12 +319,12 @@ Termination Conditions
318
319
319
320
Pyomo offers a standard set of termination conditions to map to solver
320
321
returns. The intent of
321
- :class: `TerminationCondition<pyomo.contrib.solver.results.TerminationCondition> `
322
+ :class: `TerminationCondition<pyomo.contrib.solver.common. results.TerminationCondition> `
322
323
is to notify the user of why the solver exited. The user is expected
323
- to inspect the :class: `Results<pyomo.contrib.solver.results.Results> `
324
+ to inspect the :class: `Results<pyomo.contrib.solver.common. results.Results> `
324
325
object or any returned solver messages or logs for more information.
325
326
326
- .. autoclass :: pyomo.contrib.solver.results.TerminationCondition
327
+ .. autoclass :: pyomo.contrib.solver.common. results.TerminationCondition
327
328
:noindex:
328
329
:show-inheritance:
329
330
@@ -333,13 +334,13 @@ Solution Status
333
334
334
335
Pyomo offers a standard set of solution statuses to map to solver
335
336
output. The intent of
336
- :class: `SolutionStatus<pyomo.contrib.solver.results.SolutionStatus> `
337
+ :class: `SolutionStatus<pyomo.contrib.solver.common. results.SolutionStatus> `
337
338
is to notify the user of what the solver returned at a high level. The
338
339
user is expected to inspect the
339
- :class: `Results<pyomo.contrib.solver.results.Results> ` object or any
340
+ :class: `Results<pyomo.contrib.solver.common. results.Results> ` object or any
340
341
returned solver messages or logs for more information.
341
342
342
- .. autoclass :: pyomo.contrib.solver.results.SolutionStatus
343
+ .. autoclass :: pyomo.contrib.solver.common. results.SolutionStatus
343
344
:noindex:
344
345
:show-inheritance:
345
346
@@ -351,7 +352,7 @@ Solutions can be loaded back into a model using a ``SolutionLoader``. A specific
351
352
loader should be written for each unique case. Several have already been
352
353
implemented. For example, for ``ipopt ``:
353
354
354
- .. autoclass :: pyomo.contrib.solver.ipopt.IpoptSolutionLoader
355
+ .. autoclass :: pyomo.contrib.solver.solvers. ipopt.IpoptSolutionLoader
355
356
:noindex:
356
357
:members:
357
358
:show-inheritance:
0 commit comments