Skip to content

Refactor scip.pxi file to reduce code duplication - #1284

Merged
Joao-Dionisio merged 4 commits into
scipopt:masterfrom
adamj34:model-refactor
Nov 1, 2026
Merged

Joao-Dionisio merged 4 commits into
scipopt:masterfrom
adamj34:model-refactor

Conversation

@adamj34

@adamj34 adamj34 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

This PR introduces 5 private helper function:

cdef _ensureFreshBestSol(self)
cdef SCIP_CONS* _getTransformedCons(self, Constraint cons, str expected_cons_type)
cdef SCIP_EVENTHDLR* _getEventhdlr(self, object eventhdlr)
cdef SCIP_BENDERS* _getBenders(self, object benders)
cdef SCIP_HEUR* _getHeur(self, object heur)

Everything should stay the same from the functional standpoint. The only exceptions are getDualfarkasLinear and getDualfarkasKnapsack functions, which now additionally perform a constraint type check.

@adamj34
adamj34 marked this pull request as ready for review October 31, 2026 18:57
@adamj34

adamj34 commented Oct 31, 2026

Copy link
Copy Markdown
Contributor Author

Do we want to update CHANGELOG.md for this one? I'm not sure it makes sense to mention internal changes there.

Comment thread src/pyscipopt/scip.pxi Resolved
Comment thread src/pyscipopt/scip.pxi Resolved
@Joao-Dionisio

Copy link
Copy Markdown
Member

And I agree that this doesn't need to go to the CHANGELOG :)

Comment thread src/pyscipopt/scip.pxi Resolved

@Joao-Dionisio Joao-Dionisio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you @adamj34 !

@Joao-Dionisio
Joao-Dionisio added this pull request to the merge queue Nov 1, 2026
Merged via the queue into scipopt:master with commit 4e8eaf8 Nov 1, 2026
7 checks passed
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.

2 participants