SuffixFinder: look in context for "external" data objects#3844
SuffixFinder: look in context for "external" data objects#3844blnicho merged 5 commits intoPyomo:mainfrom
Conversation
|
I can confirm this fixes the example in #3800. However, if a suffix is on the original model, the This is a defensible design decision---if the user wants scaling on the temporary block, they should copy the scaling factors over themselves. (Indeed, this is what we do currently for PETSc in IDAES.) If this is how things are intended to work, then we can close #3800. Thank you so much for getting this in before the Pyomo release. |
|
@dallan-keylogic thanks for checking this fix. For now you still have to manually transfer any suffixes you want over to the temporary block. We have some follow-on ideas related to "Suffix References" which could help with this in the future but that won't make it for this release. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3844 +/- ##
=======================================
Coverage 89.73% 89.73%
=======================================
Files 904 904
Lines 105871 105871
=======================================
+ Hits 95006 95007 +1
+ Misses 10865 10864 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixes #3800 .
Summary/Motivation:
This updates the SuffixFinder to always look in the Suffix attached to the
context(root) block for Components / ComponentDatas that are not part of thecontextmodel hierarchy.This resolves issues finding Suffixes for components that are part of References (i.e., they look like they are part of this tree, but are actually part of another tree elsewhere), and fixes #3800.
Changes proposed in this PR:
context, always check the Suffix oncontextbefore giving upLegal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: