Skip to content

Improve lp_portfolio solver compatibility when ECOS_BB is unavailable#739

Open
Whning0513 wants to merge 1 commit into
PyPortfolio:mainfrom
Whning0513:fix-lp-solver-fallback-626
Open

Improve lp_portfolio solver compatibility when ECOS_BB is unavailable#739
Whning0513 wants to merge 1 commit into
PyPortfolio:mainfrom
Whning0513:fix-lp-solver-fallback-626

Conversation

@Whning0513

Copy link
Copy Markdown

Fixes #626.

lp_portfolio() currently relies on ECOS_BB when ecos is installed and otherwise falls through to cvxpy's default solver selection. That is brittle on newer cvxpy setups where ECOS_BB is no longer commonly available by default.

This change keeps the existing ECOS_BB preference for environments that still have ecos, but otherwise picks the first installed mixed-integer solver explicitly, with HIGHS first in the fallback order. If no compatible solver is installed, it now raises a clearer OptimizationError instead of surfacing a less actionable solver failure from cvxpy.

I also added regression tests covering the HIGHS fallback path and the no-MIP-solver error case.

Fallback to HIGHS or another installed mixed-integer solver when ECOS_BB is unavailable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SolverError for discrete_allocation / lp_portfolio

1 participant