Skip to content

Interface SCIP methods - #1237

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

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

Conversation

@adamj34

@adamj34adamj34 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 threadsrc/pyscipopt/scip.pyi Outdated

Copy link
Copy Markdown
ContributorAuthor

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
ContributorAuthor

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
@codecov

codecovBot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 57.29%. Comparing base (9547994) to head (2587c2c).
⚠️ Report is 8 commits behind head on master.

Files with missing linesPatch %Lines
src/pyscipopt/scip.pxi50.00%10 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## master #1237 +/- ##
==========================================
- Coverage 57.91% 57.29% -0.62% 
==========================================
Files 26 27 +1 Lines 5807 5936 +129 ==========================================
+ Hits 3363 3401 +38 - Misses 2444 2535 +91 

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for freeto 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

@adamj34@Joao-Dionisio