Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions doc/optimizers/UNO_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ preset:
desc: |
Specifies the preset option in Uno (str).

- ``auto``: Uno picks a preset based on the problem size and the available subproblem solvers.
Large or sparse problems use ``ipopt``; smaller problems use ``filtersqp``.
- ``filtersqp``: Trust region restoration filter SQP solver.
- ``filterslp``: Trust region restoration filter SLP solver.
- ``funnelsqp``: Funnel-method SQP solver.
- ``ipopt``: line-search filter restoration infeasible interior-point solver

The default value is ``filtersqp``.
The default value is ``auto``.

# Termination Options
primal_tolerance:
Expand All @@ -45,21 +47,15 @@ dual_tolerance:

The default value is ``1e-8``.

loose_primal_tolerance:
desc: |
Loose tolerance on constraint violation (double).

The default value is ``1e-6``.

loose_dual_tolerance:
acceptable_tolerance:
desc: |
Loose tolerance on stationarity and complementarity (double).
Tolerance on the scaled primal infeasibility, stationarity and complementarity for a solution to be acceptable (double).

The default value is ``1e-6``.

loose_tolerance_iteration_threshold:
acceptable_iteration_threshold:
desc: |
Number of iterations before loose tolerance applies (int).
Number of iterations before acceptable tolerance applies (int).

The default value is ``15``.

Expand Down
20 changes: 8 additions & 12 deletions pyoptsparse/pyUno/pyUno.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
unopy = import_module("unopy")


_UNOPY_MIN_VERSION = "0.4.7"
_UNOPY_MIN_VERSION = "0.4.17"


class _UserTerminationError(Exception):
Expand Down Expand Up @@ -80,8 +80,7 @@ def __init__(self, raiseError=True, options=None):
self.jacType = "coo"

# Options handled outside of unopy's set_option interface.
# 'preset' is applied via solver.set_preset() rather than set_option().
self.pythonOptions = {"preset", "logger_stream", "save_major_iteration_variables"}
self.pythonOptions = {"logger_stream", "save_major_iteration_variables"}

# Save the result object from the optimize call separately from the
# pyoptsparse Solution object, in case the user wants more detail.
Expand Down Expand Up @@ -124,16 +123,12 @@ def _getDefaultOptions():
Default options with type and default value pairs.
"""
defOpts = {
# Special options handled differently by Uno
"preset": [str, "filtersqp"],
"logger_stream": [(TextIO, str, pathlib.Path), None],
"save_major_iteration_variables": [list, []],
"preset": [str, "auto"],
# Termination Options
"primal_tolerance": [float, 1e-8],
"dual_tolerance": [float, 1e-8],
"loose_primal_tolerance": [float, 1e-6],
"loose_dual_tolerance": [float, 1e-6],
"loose_tolerance_iteration_threshold": [int, 15],
"acceptable_tolerance": [float, 1e-6],
"acceptable_iteration_threshold": [int, 15],
"max_iterations": [int, 2000],
"time_limit": [float, float("inf")],
"unbounded_objective_threshold": [float, -1e20],
Expand All @@ -149,6 +144,9 @@ def _getDefaultOptions():
"protected_actual_reduction_macheps_coefficient": [float, 10.0],
"hessian_model": [str, "LBFGS"],
"quasi_newton_memory_size": [int, 20],
# Special options handled by the Python wrapper
"logger_stream": [(TextIO, str, pathlib.Path), None],
"save_major_iteration_variables": [list, []],
}
return defOpts

Expand Down Expand Up @@ -441,8 +439,6 @@ def _set_uno_options(self, solver):
solver : unopy.UnoSolver
The Uno solver instance to configure.
"""
solver.set_preset(self.getOption("preset"))

logger_stream = self.getOption("logger_stream")
if logger_stream is not None:
if isinstance(logger_stream, (str, pathlib.Path)):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_hs015.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_uno(self):
# Check informs
self.assert_inform_equal(sol)

@parameterized.expand(["filtersqp", "filterslp", "funnelsqp", "ipopt"])
@parameterized.expand(["auto", "filtersqp", "filterslp", "funnelsqp", "ipopt"])
def test_uno_presets(self, preset):
self.optName = "Uno"
self.setup_optProb()
Expand Down
Loading