pyomo.gdp: Fixing bugs in nested models in gdp.hull transformation#3143
Merged
emma58 merged 40 commits intoPyomo:mainfrom Feb 21, 2024
Merged
pyomo.gdp: Fixing bugs in nested models in gdp.hull transformation#3143emma58 merged 40 commits intoPyomo:mainfrom
emma58 merged 40 commits intoPyomo:mainfrom
Conversation
…d vars and constraints on transformed model
…rmance improvements in the variable gathering logic
…ate some tests, fixing a bug in GDPTree.parent_disjunct method
…ed, simplifying how we deal with local vars significantly.
…med them, which is useless becuase we've deactivated them
…he fact that constraints might get transformed multiple times.
…gregating them anyway
…nstraints than we expect (which currently we do)
…ith Vars declared as local that don't actually appear on the Disjunct, realizing that bound constraints at each level of the GDP tree matter.
…o tests because of this
jsiirola
reviewed
Feb 20, 2024
pyomo/gdp/plugins/hull.py
Outdated
Comment on lines
+654
to
+657
| original_var_info = original_var.parent_block().private_data() | ||
| if 'disaggregated_var_map' not in original_var_info: | ||
| original_var_info['disaggregated_var_map'] = ComponentMap() | ||
| disaggregated_var_map = original_var_info['disaggregated_var_map'] |
Member
There was a problem hiding this comment.
We should add a default= or initialize= argument to private_data() that the method can use to initialize the private dict if it is not present.
Member
There was a problem hiding this comment.
Scratch that - we implemented this as an explicit registration: #3153
jsiirola
approved these changes
Feb 21, 2024
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.
Fixes # .
Summary/Motivation:
This fixes several bugs in hull having to do with nested GDPs:
Most notably, in order to accomplish the above, this switches the hull transformation from transforming from root to leaf in the GDP tree to the opposite. Note that this is the reason that the baselines changed and that the FME tests changed (and can be blamed for lots of other chaos as well).
Changes proposed in this PR:
private_datamagic, though does not do this completely yet--I will save that for a later PRLegal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: