OpenMDAO / OpenMDAO/Aviary

Remove `get_option_defaults`

Open
#1,251 1 comment 0 reactions 7 assignees View on GitHub

@Kenneth-T-Moore is already working on this.

Since Aug 4, 2026.

good first issue request validation
Dominant language
Python
Stars
287
Forks
140
Avg merge
6d 14h
Merged PRs (30d)
18

Description

Desired capability or behavior.

The utility get_option_defaults() (in aviary.variable_info.options.py) which sets up an AviaryValues object with every variable set to their default units. This is often used to set up tests. This util makes the tests extremely annoying to debug because it makes it very opaque which inputs are being set that the component actually uses, and what value they are set to. The defaults are mostly zero anyway, and also add an unnecessary dependency for tests on default values in metadata. If a default is change, it shouldn't break every single test using that variable.

TLDR: get_option_defaults() is a shortcut that obscures 1. what variables are actually necessary for a test, 2. their values, and 3. creates fragile dependencies for the tests on the current metadata defaults

Suggested implementation.

Update tests to not use get_option_defaults() and instead directly set input values for the OM problem. If there are no special cases where get_option_defaults() is absolutely essential, it should be completely removed. I can't think of any good reasons why this should exist, as it is a dangerous tool that looks like a handy shortcut but can be a little bit of a trap for the aforementioned reasons.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.