Skip to content

Don't overwrite driver opt_settings specified by user#1148

Merged
jkirk5 merged 2 commits into
OpenMDAO:mainfrom
jkirk5:cleanup
May 29, 2026
Merged

Don't overwrite driver opt_settings specified by user#1148
jkirk5 merged 2 commits into
OpenMDAO:mainfrom
jkirk5:cleanup

Conversation

@jkirk5
Copy link
Copy Markdown
Contributor

@jkirk5 jkirk5 commented May 15, 2026

Summary

AviaryProblem.add_driver() no longer overwrites any settings in driver.opt_settings if they already exist (such as manually set by user beforehand)

Related Issues

Backwards incompatibilities

None

New Dependencies

None

driver.opt_settings['nlp_scaling_method'] = 'gradient-based'
driver.opt_settings['alpha_for_y'] = 'safer-min-dual-infeas'
driver.opt_settings['mu_strategy'] = 'monotone'
driver.opt_settings.setdefault('nlp_scaling_method', 'gradient-based')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the only defaults currently in OpenMDAO:

DEFAULT_OPT_SETTINGS['IPOPT'] = {
    'hessian_approximation': 'limited-memory',
    'nlp_scaling_method': 'user-scaling',
    'linear_solver': 'mumps'

I see we change nlp_scaling_method here in Aviary, and it is probably intentional, so we should probably just set it.

Copy link
Copy Markdown
Contributor Author

@jkirk5 jkirk5 May 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those defaults don't seem to kick in at this point (we've only created a fresh pyoptsparse driver at this point, no OM involvement yet), I've verified the dicts start out empty regardless of which optimizer you are using

@jkirk5 jkirk5 enabled auto-merge May 27, 2026 16:17
@jkirk5 jkirk5 requested a review from Kenneth-T-Moore May 28, 2026 22:26
@jkirk5 jkirk5 added this pull request to the merge queue May 29, 2026
Merged via the queue into OpenMDAO:main with commit 281061d May 29, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Methods for Level 2 Overwrites Optimizer Settings

2 participants