Skip to content

Expose lp basis methods#1199

Merged
Joao-Dionisio merged 4 commits intomasterfrom
expose-lp-basis-methods
Mar 16, 2026
Merged

Expose lp basis methods#1199
Joao-Dionisio merged 4 commits intomasterfrom
expose-lp-basis-methods

Conversation

@Joao-Dionisio
Copy link
Member

Fix #1195

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #1195 by exposing LP basis information in the Python LP API, including an enum for basis statuses and a regression test to ensure basis round-tripping works.

Changes:

  • Added LP.getBase() / LP.setBase() for retrieving and restoring column/row basis statuses via SCIP’s LPI.
  • Exposed basis status constants as SCIP_BASESTAT from the package.
  • Added a test exercising basis get/set and verifying basis preservation after re-solve.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/pyscipopt/lp.pxi Implements LP.getBase() / LP.setBase() using SCIPlpiGetBase / SCIPlpiSetBase.
src/pyscipopt/scip.pxd Adds C declarations for SCIPlpiGetBase / SCIPlpiSetBase.
src/pyscipopt/scip.pxi Exposes PY_SCIP_BASESTAT mapping to SCIP base status constants.
src/pyscipopt/scip.pyi Updates typing stubs to include LP.getBase, LP.setBase, and PY_SCIP_BASESTAT.
src/pyscipopt/__init__.py Re-exports PY_SCIP_BASESTAT as SCIP_BASESTAT.
tests/test_lp.py Adds basis get/set test coverage for the LP class.
CHANGELOG.md Documents the newly added LP basis APIs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@Joao-Dionisio Joao-Dionisio merged commit f7fc8fa into master Mar 16, 2026
3 checks passed
@Joao-Dionisio Joao-Dionisio deleted the expose-lp-basis-methods branch March 18, 2026 12:49
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.

Please expose LP method and basis info

2 participants