Improve lp_portfolio solver compatibility when ECOS_BB is unavailable#739
Open
Whning0513 wants to merge 1 commit into
Open
Improve lp_portfolio solver compatibility when ECOS_BB is unavailable#739Whning0513 wants to merge 1 commit into
Whning0513 wants to merge 1 commit into
Conversation
Fallback to HIGHS or another installed mixed-integer solver when ECOS_BB is unavailable.
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 #626.
lp_portfolio()currently relies onECOS_BBwhenecosis installed and otherwise falls through to cvxpy's default solver selection. That is brittle on newer cvxpy setups whereECOS_BBis no longer commonly available by default.This change keeps the existing
ECOS_BBpreference for environments that still haveecos, but otherwise picks the first installed mixed-integer solver explicitly, withHIGHSfirst in the fallback order. If no compatible solver is installed, it now raises a clearerOptimizationErrorinstead of surfacing a less actionable solver failure from cvxpy.I also added regression tests covering the
HIGHSfallback path and the no-MIP-solver error case.