Interface SCIP methods missing from PySCIPOpt#1236
Conversation
|
Thank you @adamj34 , this looks good! How many other methods did you interface? It may be good to add a bunch at a time, to avoid merging too many PRs and spamming our followers. |
|
@Joao-Dionisio I could interface a few more. I wanted to keep it simple for the first PR but I can add the rest in bulk, as you suggested. I see that there's an error in the CI pipeline: Should new methods be added there by hand, or it's supposed to be automated in some way (by the .pre-commit-config.yaml hook, possibly)? |
That's fair, we can merge this one and do the bulk one later.
We've started working on adding stubs this year, so for now this is still something that needs to be done manually, but hopefuly not for much longer. There is a stub generator, but it's not working yet. |
|
ok, I've added it manually |
| SCIP_Longint SCIPgetNNodeLPIterations(SCIP* scip) | ||
| SCIP_Longint SCIPgetNStrongbranchLPIterations(SCIP* scip) | ||
| SCIP_Real SCIPgetPrimalDualIntegral(SCIP* scip) | ||
| int SCIPgetNRuns(SCIP* scip) |
There was a problem hiding this comment.
Can you please order this roughly in the order in which they appear in the SCIP documentation?
| SCIP_Real SCIPgetPrimalDualIntegral(SCIP* scip) | ||
| int SCIPgetNRuns(SCIP* scip) | ||
| int SCIPgetNReoptRuns(SCIP* scip) | ||
| void SCIPaddNNodes(SCIP* scip, SCIP_Longint nnodes) |
There was a problem hiding this comment.
Can you let me know what's the use of this method? Is it to let SCIP know that there were more nodes that were hidden from it somehow?
There was a problem hiding this comment.
Ah, I'm guessing it's because of sub-SCIPs, etc. In any case, perhaps adding a line to the PySCIPOpt docstring explaining this would be nice.
There was a problem hiding this comment.
from the functional standpoint, it increments scip->stat->nnodes and scip->stat->ntotalnodes
as far as concrete use cases are concerned, I'm not sure about them but your guess looks reasonable
| SCIP_RETCODE SCIPgetNSiblings(SCIP* scip) | ||
| SCIP_RETCODE SCIPgetLeaves(SCIP* scip, SCIP_NODE*** leaves, int* nleaves) | ||
| SCIP_Longint SCIPgetNLeaves(SCIP* scip) | ||
| SCIP_Longint SCIPgetNNodesLeft(SCIP* scip) |
There was a problem hiding this comment.
| SCIP_Longint SCIPgetNNodesLeft(SCIP* scip) | |
| int SCIPgetNNodesLeft(SCIP* scip) |
Wrap SCIPgetNNodesLeft and append a check to an existing test