Skip to content

Unopy 0.4.15 changed options, now causes failures with pyoptsparse #500

Open

Description

@robfalck

Description

pyUNO registers loose_primal_tolerance, loose_dual_tolerance and loose_tolerance_iteration_threshold as default options. Uno removed these options in v2.9.1 (unopy 0.4.15), replacing them with an "acceptable termination" scheme.

Because pyOptSparse passes every option, including untouched defaults, to solver.set_option, any use of the Uno optimizer with unopy 0.4.15 or newer fails, even if the user never sets these options.

I think pyoptsparse should limit the default options listed for Uno to a small, stable set and leave the rest to Uno's own defaults and presets.

Steps to reproduce issue

  1. Install pyOptSparse 2.16.0 and unopy 0.4.15 (Uno 2.9.1).
  2. Run any optimization with OPT("Uno"), for example the pyOptSparse tutorial problem, or an OpenMDAO pyOptSparseDriver with optimizer='Uno'.
  3. Observe that the optimizer fails when options are applied, before the first iteration.

Minimal check of the underlying cause:

import unopy
s = unopy.UnoSolver()
s.set_option('primal_tolerance', 1e-8)         # OK
s.set_option('loose_primal_tolerance', 1e-6)   # KeyError: 'loose_primal_tolerance does not exist'

I applied each of the 20 defaults registered in pyUNO.py to unopy 0.4.15. The only rejected ones are the three loose_* options. save_major_iteration_variables is a Python-side option and is not forwarded to set_option.

Current behavior

pyUNO.py defines these defaults (around line 134):

"loose_primal_tolerance": [float, 1e-6],
"loose_dual_tolerance": [float, 1e-6],
"loose_tolerance_iteration_threshold": [int, 15],

and then calls solver.set_option(name, value) for every option not in pythonOptions (around line 458). With unopy >= 0.4.15 this raises KeyError: 'loose_primal_tolerance does not exist'.

Other option changes between Uno v2.9.0 and v2.9.1:

Option (v2.9.0) Status in v2.9.1 set_option in unopy 0.4.15
loose_primal_tolerance, loose_dual_tolerance, loose_tolerance_iteration_threshold removed; replaced by acceptable_* and tight_unscaled_* options (#974) rejected
switching_objective_exponent renamed to switching_merit_exponent old name rejected, new name accepted
filter_type removed (only standard existed) rejected
funnel_switching_infeasibility_exponent removed; the funnel preset now uses switching_infeasibility_exponent rejected
switch_to_optimality_requires_acceptance removed rejected
hessian_model (default exact), inertia_correction_strategy (default primal) no longer set in DefaultOptions.cpp still accepted

New options in v2.9.1:

  • tight_unscaled_{stationarity,primal_infeasibility,complementarity}_tolerance
  • acceptable_tolerance
  • acceptable_unscaled_{stationarity,primal_infeasibility,complementarity}_tolerance
  • acceptable_objective_change_tolerance
  • acceptable_iteration_threshold
  • bound_multiplier_max_norm
  • bound_relaxation_factor
  • constraint_violation_tolerance
  • filter_margin_uses_entry_infeasibility
  • function_scaling_lower_bound
  • print_extended_statistics
  • print_minor_iterations
  • regularize_all_variables
  • use_proximal_term

The presets also changed (for example ipopt now sets use_proximal_term and regularize_all_variables), so preset behaviour is not identical across these versions either.

pyOptSparse only registers the three loose_* options among the removed ones, so only they break the wrapper today. A user who passes filter_type, switching_objective_exponent and similar options through OPT("Uno", options=...) will hit the same KeyError.

Expected behavior

OPT("Uno") should work with the current release of unopy. Ideally the wrapper should not break on upstream option renames or removals.

Code versions

  • Operating System: macOS 26.7.1 (arm64)
  • Python: 3.11.15
  • OpenMPI: N/A
  • CGNS: N/A
  • PETSc: N/A
  • Compiler: N/A (unopy installed as a prebuilt wheel)
  • unopy: 0.4.15 (Uno 2.9.1) fails; 0.4.14 (Uno 2.9.0) and earlier work
  • This repository: pyOptSparse 2.16.0

Activity

  1. linked a pull request that will close this issueUpdated the pyUno options (unopy v0.4.15) #501on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions