Refactor level2 to eliminate the input_sink and set all input defaults in the top group's configure method. #132
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Prior to this change, the level 2 interface handled setting the model's input defaults by a call to a utility function right before setup. Since at this point, it isn't possible to figure out what inputs are in the model, we called set_input_defaults on everything in the aircraft metadata. Unfortunately, if you promote an input that isn't in the model, OpenMDAO raises an error. Our original workaround was to create the "input_sink" component, which contained almost every variable in the metadata dictionary. This approach caused other problems that we have gradually discovered...
This PR is a re-implementation, where we delay calling set_input_defaults until the top group's configure method. At this point, we know all of our subsystem's inputs and can query them, so we no longer need the input_sink.
Related Issues
Backwards incompatibilities
None
New Dependencies
None