Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve lp_portfolio solver compatibility when ECOS_BB is unavailable#739

Open
Whning0513 wants to merge 1 commit into
PyPortfolio:main from
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:main from
Whning0513:fix-lp-solver-fallback-626

Conversation

@Whning0513

@Whning0513 Whning0513 commented Jun 21, 2026

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

SolverError for discrete_allocation / lp_portfolio

1 participant

AltStyle によって変換されたページ (->オリジナル) /