Skip to content

Interface SCIP methods#1237

Open
adamj34 wants to merge 11 commits into
scipopt:masterfrom
adamj34:interface
Open

Interface SCIP methods#1237
adamj34 wants to merge 11 commits into
scipopt:masterfrom
adamj34:interface

Conversation

@adamj34

@adamj34 adamj34 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Adds the following methods:
getNNodesLeft(), getNRuns(), getNReoptRuns(), addNNodes(), getDeterministicTime(), getAvgDualbound(), getMaxTotalDepth(), getNBacktracks(), getFocusNode(), getAvgLowerbound(), getFirstPrimalBound(), getLowerboundRoot(), getUpperbound(), getNObjlimLeaves()

Adds tests in tests/test_statistics.py for migrated methods

Adds function signatures to scip.pyi for hints

Updates CHANGELOG.md

Comment thread src/pyscipopt/scip.pyi Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Joao-Dionisio were there some changes in the ruff config? I didn't even touch these lines in my commits.

If it's ok I can refactor it to use the more modern X | Y syntax as suggested in the error message

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.

This is likely just a new ruff version flagging some errors. I'd just merge without caring much about this, but if you're offering to fix this, I'm more than happy to accept :)

I'll take a little bit to review, but everything seems to be in order. Can you please make sure that the optimized_model() manages to find primal solutions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I checked that optmized_model() wasn't able to find any primal solution, so I 've increased the node limit parameter and now it finds 1.

Regarding the X | Y syntax, I only changed it in scip.pyi to pass the pipeline checks and because this syntax is already used there.

I was thinking about replacing typing.Union in the entire repo, but in general such fixes are considered unsafe for Python versions prior to 3.10 (see for reference: https://docs.astral.sh/ruff/rules/non-pep604-annotation-union/) and pyproject.toml only requires python>=3.8. Maybe there's no point in touching it until the project moves to python>=3.10?

@adamj34
adamj34 marked this pull request as ready for review July 25, 2026 19:46
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