Skip to content

Simplified API for input/output helper functions#1206

Open
jkirk5 wants to merge 8 commits into
OpenMDAO:mainfrom
jkirk5:1196_component_defaults
Open

Simplified API for input/output helper functions#1206
jkirk5 wants to merge 8 commits into
OpenMDAO:mainfrom
jkirk5:1196_component_defaults

Conversation

@jkirk5

@jkirk5 jkirk5 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Removed the val argument from the helper functions add_aviary_input and add_aviary_output, which previously was always being reset to the metadata default regardless.

Claude Haiku 4.5 was used to change the use of inputs.values() to individual calls to get the values of individual inputs in gaspaero for significantly improved readability/traceability/search-ability of the code.

Related Issues

Backwards incompatibilities

I stumbled upon opt2vals in the 2dof taxi and it appears to be redundant, so I removed it. That is the only place it is being used and seems like it can just be directly set as an input (via the input csv) rather than an option that then becomes an input.

New Dependencies

None

@jkirk5 jkirk5 changed the title 1196 component defaults Simplified API for input/output helper functions Jun 26, 2026
"""

def setup(self):
# Temporarily set this to shape (1, 1) to avoid OpenMDAO bug

@Kenneth-T-Moore Kenneth-T-Moore Jun 29, 2026

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.

This component appears to be unused outside of its unit test, which is why it has dynamic inputs that aren't shaped by num_nodes. I think we can delete it and its test.

EDIT: We actually replaced the component with an excecomp, so yeah, it is redundant now.

EDIT: WE might need to bring the v_rotation component back, because gravity is going to become an option instead of a bare input. This overlaps with Eliot's story, and with mine too, since I need to move that component into the takeoff ode. Probably leave it there for now.

# Pulling the default from the MetaData if it does not exist instead.
# TODO find a better way to handle this
if Mission.Taxi.MACH not in options:
default_val = CoreMetaData[Mission.Taxi.MACH]['default_value']

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.

Mission.Taxi.MACH is still an option, and we don't do a set_val on options from the Aviary top, so I think you still need to get the value out of the metadata or options and set it as the default value for taxi_mach in the alias_comp definition below this. Otherwise, taxi mach is 0.0 as per the set_input_defaults at the bottom (which also should be removed.)

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.

Any custom defaults set in components are overwritten by metadata defaults

2 participants