Prevent "shape_by_conn" hierarchy variables from being set to a stale default value.#1088
Open
Kenneth-T-Moore wants to merge 5 commits intoOpenMDAO:mainfrom
Open
Prevent "shape_by_conn" hierarchy variables from being set to a stale default value.#1088Kenneth-T-Moore wants to merge 5 commits intoOpenMDAO:mainfrom
Kenneth-T-Moore wants to merge 5 commits intoOpenMDAO:mainfrom
Conversation
jkirk5
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This fixes a bug found by Irian when using an post-mission external subsystem with a custom hierarchy variable "cg" as an input. The length of the cg vector is not known until all dymos phases are instantiated, so the variable was declared with "shape_by_conn" set to True so that the shape could be computed dynamically. The Aviary bug occurs because aviary_group sets default initial values and units for all hierarchy variables in the model, which derails the dynamic shape determination by setting a bogus shape.
This fix finds all shape_by_conn hiearchy variables and excludes them from setting a value.
Related Issues
Backwards incompatibilities
None
New Dependencies
None