Use scaling factors in solve_strongly_connected_components#3995
Open
dallan-keylogic wants to merge 6 commits into
Open
Use scaling factors in solve_strongly_connected_components#3995dallan-keylogic wants to merge 6 commits into
dallan-keylogic wants to merge 6 commits into
Conversation
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.
Dependent on #3993.
Fixes #3785.
Summary/Motivation:
Projects like PrOMMiS are increasingly relying on IDAES's
BlockTriangularizationInitializer, which in turn relies onsolve_strongly_connected_components. However, in models that need significant amounts of scaling, the initialization raises an error that the constraint residuals are not small. That's becauseBlockTriangularizationInitializertakes constraint scaling into account butsolve_strongly_connected_componentsdoes not.This PR finishes addressing that problem by adding a function to copy scaling factors from one block to another and adding an option to
solve_strongly_connected_componentsto allowChanges proposed in this PR:
copy_scaling_factors_to_blockfunction.solve_strongly_connected_componentsAI-Use Disclosure
Notes for reviewers (optional): My use of
unittest.mockin the testing here was deliberate and not a result of using AI. It allows us to test which options are being passed to subfunctions, the number of times those subfunctions are called, and avoids needing to call IPOPT or another full solver.Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution: