Fixed the choice of PULP solver issue - #119
Merged
Merged
Conversation
lizliz
requested review from
ishikaghosh2201
and
a lite review from Copilot
September 22, 2026 14:39
Closed
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Solver discovery does not match PuLP’s canonical names, and focused selector tests are missing.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (2)
What changed in this PR
This PR makes PuLP solver selection environment-aware and updates the package version.
Changes:
- Adds configurable solver and CBC path selection.
- Applies the selected solver to both ILP paths.
- Bumps the version to
0.1.17.
| File | Summary |
|---|---|
pyproject.toml |
Updates the package version. |
cereeberus/cereeberus/distance/ilp.py |
Adds solver selection and integrates it into ILP solving. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
ishikaghosh2201
approved these changes
Sep 22, 2026
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.


Description
This change makes the PuLP solver selection explicit and environment-aware instead of relying on a bundled CBC binary from the local virtual environment.
The root cause was that the project could silently launch an incompatible CBC executable in the
.venv, which causedBad CPU type in executablefailures on macOS when running the interleaving optimization. The fix prefers the active environment’s installed CBC binary, honors explicit solver path overrides, and uses the supported PuLPCOIN_CMD(..., path=...)API for custom CBC locations.This keeps solver selection controllable across environments and avoids other users hitting the same branch-specific architecture mismatch.
Motivation and Context
The interleaving optimization path calls into PuLP to solve the ILP. In this environment, the bundled CBC in the virtualenv was not compatible with the machine architecture, so optimization crashed before the actual algorithm could run.
This change is required to make the solver choice deterministic and safe across local developer environments, conda environments, and CI setups.
How has this been tested?
By running
make testsTypes of changes
Checklist
pyproject.tomlfile if a new version needs to be pushed to pypi. Note that if the number isn't incremented, the package will not be pushed to pypi, which is useful if this PR is only for updating documentation.make formatto clean up the code withblack.make tests).