Skip to content

Commit b9ee233

Browse files
authored
Merge branch 'scipopt:master' into build
2 parents 2538f41 + b3f298d commit b9ee233

60 files changed

Lines changed: 5408 additions & 1409 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build_wheels.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ jobs:
2828
include:
2929
- os: ubuntu-22.04
3030
arch: x86_64
31+
- os: ubuntu-24.04-arm
32+
arch: aarch64
3133
- os: macos-14
3234
arch: arm64
33-
- os: macos-13
35+
- os: macos-15-intel
3436
arch: x86_64
3537
- os: windows-latest
3638
arch: AMD64
@@ -39,15 +41,14 @@ jobs:
3941

4042
steps:
4143
- uses: actions/checkout@v4
42-
44+
4345
- name: Build wheels
44-
uses: pypa/cibuildwheel@v2.21.1
46+
uses: pypa/cibuildwheel@v3.2.1
4547
env:
4648
CIBW_ARCHS: ${{ matrix.arch }}
47-
CIBW_TEST_GROUPS: test
49+
CIBW_BEFORE_TEST: "pip install -r {project}/requirements/test.txt"
4850
CIBW_TEST_COMMAND: "pytest {project}/tests"
49-
CIBW_MANYLINUX_*_IMAGE: manylinux_2_28
50-
51+
5152
- uses: actions/upload-artifact@v4
5253
with:
5354
name: wheels-${{ matrix.os}}-${{ matrix.arch }}
@@ -100,4 +101,3 @@ jobs:
100101
user: __token__
101102
password: ${{ secrets.TESTPYPI_API_TOKEN }}
102103
verbose: true
103-

.github/workflows/coverage.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Run tests with coverage
22
env:
3-
version: 9.2.3
3+
version: 10.0.0
44

55
on:
66
push:
@@ -25,8 +25,8 @@ jobs:
2525

2626
- name: Install dependencies (SCIPOptSuite)
2727
run: |
28-
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu22.deb
29-
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu22.deb
28+
wget --quiet --no-check-certificate "https://github.com/scipopt/scip/releases/download/v${{ env.version }}/scipoptsuite_${{ env.version }}-1+jammy_amd64.deb"
29+
sudo apt-get update && sudo apt install -y ./scipoptsuite_${{ env.version }}-1+jammy_amd64.deb
3030
3131
- name: Setup python ${{ matrix.python-version }}
3232
uses: actions/setup-python@v4
@@ -40,7 +40,7 @@ jobs:
4040
4141
- name: Install PySCIPOpt
4242
run: |
43-
export CFLAGS="-O0 -ggdb -Wall -Wextra -Werror" # Debug mode. More warnings. Warnings as errors.
43+
export CFLAGS="-O0 -ggdb -Wall -Wextra -Werror -Wno-error=deprecated-declarations" # Debug mode. More warnings. Warnings as errors, but allow deprecated declarations.
4444
python -m pip install . -v 2>&1 | tee build.log
4545
grep -i "warning" build.log || true
4646

.github/workflows/integration-test.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Integration test
22

33
env:
4-
version: 9.2.3
4+
version: 10.0.0
55

66
on:
77
push:
@@ -23,8 +23,8 @@ jobs:
2323

2424
- name: Install dependencies (SCIPOptSuite)
2525
run: |
26-
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu22.deb
27-
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu22.deb
26+
wget --quiet --no-check-certificate "https://github.com/scipopt/scip/releases/download/v${version}/scipoptsuite_${version}-1+jammy_amd64.deb"
27+
sudo apt-get update && sudo apt install -y ./scipoptsuite_${version}-1+jammy_amd64.deb
2828
2929
- name: Setup python ${{ matrix.python-version }}
3030
uses: actions/setup-python@v4
@@ -54,8 +54,11 @@ jobs:
5454

5555
- name: Download dependencies (SCIPOptSuite)
5656
shell: powershell
57-
run: wget https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-win64.exe -outfile scipopt-installer.exe
58-
57+
run: |
58+
$v = "${{ env.version }}"
59+
$url = "https://github.com/scipopt/scip/releases/download/v$($v)/scipoptsuite-$($v)-win-x64.exe"
60+
Write-Host "Downloading $url"
61+
Invoke-WebRequest -Uri $url -OutFile scipopt-installer.exe
5962
- name: Install dependencies (SCIPOptSuite)
6063
shell: cmd
6164
run: scipopt-installer.exe /S /D=${{ env.SCIPOPTDIR }}
@@ -92,10 +95,16 @@ jobs:
9295
- name: Install dependencies (SCIPOptSuite)
9396
run: |
9497
brew install tbb boost bison
95-
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Darwin.sh
96-
chmod +x SCIPOptSuite-${{ env.version }}-Darwin.sh
97-
./SCIPOptSuite-${{ env.version }}-Darwin.sh --skip-license --include-subdir
98-
mv SCIPOptSuite-${{ env.version }}-Darwin ${{ github.workspace }}/scipoptsuite
98+
echo 'export PATH="/opt/homebrew/opt/bison/bin:$PATH"' >> $HOME/.bash_profile
99+
echo 'export LDFLAGS="-L/opt/homebrew/opt/bison/lib"' >> $HOME/.bash_profile
100+
source $HOME/.bash_profile
101+
v="${version}"
102+
url="https://github.com/scipopt/scip/releases/download/v${v}/scipoptsuite-${v}-macos13-arm64.tgz"
103+
echo "Downloading ${url}"
104+
curl -L -o scipoptsuite.tgz "${url}"
105+
mkdir -p "${{ github.workspace }}/scipoptsuite"
106+
tar -xzf scipoptsuite.tgz -C "${{ github.workspace }}/scipoptsuite" --strip-components=1
107+
ls -la "${{ github.workspace }}/scipoptsuite"
99108
100109
- name: Setup python ${{ matrix.python-version }}
101110
uses: actions/setup-python@v4
@@ -122,4 +131,3 @@ jobs:
122131
### if you need valgrind on mac, you can install it via
123132
# brew tap LouisBrunner/valgrind
124133
# brew install --HEAD LouisBrunner/valgrind/valgrind
125-

.github/workflows/stubs.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Check type stubs
2+
env:
3+
version: 10.0.0
4+
5+
on:
6+
push:
7+
branches:
8+
- "master"
9+
pull_request:
10+
types: [opened, synchronize, reopened, ready_for_review]
11+
branches:
12+
- "master"
13+
workflow_dispatch:
14+
15+
defaults:
16+
run:
17+
shell: bash
18+
19+
jobs:
20+
stubtest:
21+
if: (github.event_name != 'pull_request') || (github.event.pull_request.draft == false)
22+
runs-on: ubuntu-24.04
23+
env:
24+
PYTHON_VERSION: "3.14"
25+
26+
steps:
27+
- uses: actions/checkout@v6
28+
29+
- name: Install dependencies (SCIPOptSuite)
30+
run: |
31+
wget --quiet --no-check-certificate "https://github.com/scipopt/scip/releases/download/v${{ env.version }}/scipoptsuite_${{ env.version }}-1+jammy_amd64.deb"
32+
sudo apt-get update && sudo apt install -y ./scipoptsuite_${{ env.version }}-1+jammy_amd64.deb
33+
34+
- name: Setup python ${{ env.PYTHON_VERSION }}
35+
uses: actions/setup-python@v4
36+
with:
37+
python-version: ${{ env.PYTHON_VERSION }}
38+
39+
- name: Install mypy
40+
run: |
41+
python -m pip install mypy
42+
43+
- name: Install PySCIPOpt
44+
run: |
45+
export CFLAGS="-O0 -ggdb -Wall -Wextra -Werror -Wno-error=deprecated-declarations" # Debug mode. More warnings. Warnings as errors, but allow deprecated declarations.
46+
python -m pip install . -v 2>&1 | tee build.log
47+
48+
- name: Run MyPy
49+
run: python -m mypy --package pyscipopt
50+
51+
- name: Run stubtest
52+
run: stubs/test.sh
53+
54+
lint:
55+
runs-on: ubuntu-latest
56+
env:
57+
FILES: src/pyscipopt/scip.pyi
58+
59+
steps:
60+
- uses: actions/checkout@v6
61+
62+
- name: Install Ruff
63+
uses: astral-sh/ruff-action@v3
64+
with:
65+
args: "--version"
66+
67+
- name: Lint type stubs
68+
run: ruff check ${{ env.FILES }} --extend-select ANN,I,PYI,RUF100
69+
70+
- name: Format type stubs
71+
run: ruff format ${{ env.FILES }}

.github/workflows/test-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: TestPyPI release
22

33
env:
4-
version: 9.2.3
4+
version: 10.0.0
55

66

77
# runs only when a release is published, not on drafts
@@ -17,8 +17,8 @@ jobs:
1717

1818
- name: Install dependencies (SCIPOptSuite)
1919
run: |
20-
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
21-
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
20+
wget --quiet --no-check-certificate "https://github.com/scipopt/scip/releases/download/v${version}/scipoptsuite_${version}-1+jammy_amd64.deb"
21+
sudo apt-get update && sudo apt install -y ./scipoptsuite_${version}-1+jammy_amd64.deb
2222
2323
- name: Setup python 3
2424
uses: actions/setup-python@v4

.github/workflows/update-packages-and-documentation.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Test and Release PyPI Package
22

33
env:
4-
version: 9.2.3
4+
version: 10.0.0
55

66

77
# runs only when a release is published, not on drafts
@@ -38,8 +38,8 @@ jobs:
3838

3939
- name: Install dependencies (SCIPOptSuite)
4040
run: |
41-
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
42-
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
41+
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/scipoptsuite_${{ env.version }}-1+jammy_amd64.deb
42+
sudo apt-get update && sudo apt install -y ./scipoptsuite_${{ env.version }}-1+jammy_amd64.deb
4343
4444
- name: Setup python ${{ matrix.python-version }}
4545
uses: actions/setup-python@v4
@@ -71,7 +71,9 @@ jobs:
7171

7272
- name: Download dependencies (SCIPOptSuite)
7373
shell: powershell
74-
run: wget https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-win64-VS15.exe -outfile scipopt-installer.exe
74+
run: |
75+
$url = "https://github.com/scipopt/scip/releases/download/v${{ env.version }}/scipoptsuite-${{ env.version }}-win-x64.exe"
76+
Invoke-WebRequest -Uri $url -OutFile scipopt-installer.exe
7577
7678
- name: Install dependencies (SCIPOptSuite)
7779
shell: cmd
@@ -107,8 +109,8 @@ jobs:
107109

108110
- name: Install dependencies (SCIPOptSuite)
109111
run: |
110-
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
111-
sudo apt-get update && sudo apt install -y ./SCIPOptSuite-${{ env.version }}-Linux-ubuntu20.deb
112+
wget --quiet --no-check-certificate https://github.com/scipopt/scip/releases/download/$(echo "v${{env.version}}" | tr -d '.')/scipoptsuite_${{ env.version }}-1+jammy_amd64.deb
113+
sudo apt-get update && sudo apt install -y ./scipoptsuite_${{ env.version }}-1+jammy_amd64.deb
112114
113115
- name: Setup python 3
114116
uses: actions/setup-python@v4

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,64 @@
22

33
## Unreleased
44
### Added
5+
- Added automated script for generating type stubs
6+
- Include parameter names in type stubs
7+
- Speed up MatrixExpr.sum(axis=...) via quicksum
8+
- Added structured_optimization_trace recipe for structured optimization progress tracking
9+
### Fixed
10+
- getBestSol() now returns None for infeasible problems instead of a Solution with NULL pointer
11+
- all fundamental callbacks now raise an error if not implemented
12+
- Fixed the type of MatrixExpr.sum(axis=...) result from MatrixVariable to MatrixExpr.
13+
- Updated IIS result in PyiisfinderExec()
14+
- Model.getVal now supports GenExpr type
15+
- Fixed lotsizing_lazy example
16+
- Fixed incorrect getVal() result when _bestSol.sol was outdated
17+
- Fixed segmentation fault when using Variable or Constraint objects after freeTransform() or Model destruction
18+
### Changed
19+
- changed default value of enablepricing flag to True
20+
- Speed up MatrixExpr.add.reduce via quicksum
21+
- Speed up np.ndarray(..., dtype=np.float64) @ MatrixExpr
22+
- Minimum numpy version increased from 1.16.0 to 1.19.0
23+
### Removed
24+
25+
## 6.0.0 - 2025.xx.yy
26+
### Added
27+
- Support for SCIP 10.0.0
28+
- Added support for IIS - Irreducible Inconsistent Subsystems
29+
- Added 4 new events: TYPECHANGED, IMPLTYPECHANGED, DUALBOUNDIMPROVED, GAPUPDATED.
30+
- Support for new implied integrality
31+
- Wrapped varIsBinary(), varIsIntegral(), varIsImpliedIntegral(), varIsNonImpliedIntegral(), varGetImplType()
32+
- Interfaced some exact SCIP methods
33+
- wrapped SCIPprintStatisticsJson
34+
### Fixed
35+
### Changed
36+
### Removed
37+
- Removed methods chgAndConsCheckFlagWhenUpgr, chgAndConsRemovableFlagWhenUpgr
38+
39+
## 5.7.0 - 2025.11.17
40+
### Added
541
- Added possibility of having variables in exponent.
642
- Added basic type stubs to help with IDE autocompletion and type checking.
743
- MatrixVariable comparisons (<=, >=, ==) now support numpy's broadcast feature.
44+
- Added methods: getMaxDepth(), getPlungeDepth(), getLowerbound(), getCutoffbound(), getNNodeLPIterations(), getNStrongbranchLPIterations().
45+
- setup.py now automatically detects conda environments when SCIPOPTDIR is not defined.
46+
- Added function getStatus() to get variable status in variable class
47+
- Added function isActive() to get whether a variable is active in variable class
48+
- Added function markDoNotAggrVar() to prevent a variable from being aggregated
49+
- Added function markDoNotMultaggrVar() to prevent a variable from being multi-aggregated
850
### Fixed
951
- Implemented all binary operations between MatrixExpr and GenExpr
1052
- Fixed the type of @ matrix operation result from MatrixVariable to MatrixExpr.
53+
- Fixed the case for returning None from the nodeselect callback in Node Selector plugins.
54+
- Fixed segmentation fault during Benders decomposition cleanup caused by double-free bug
1155
### Changed
1256
- Add package extras for test dependencies in `pyproject.toml`
1357
- Speed up MatrixVariable.sum(axis=None) via quicksum
1458
- MatrixVariable now supports comparison with Expr
59+
- Benders subproblem memory is now automatically managed by the master Model - `freeBendersSubproblems()` is deprecated and no longer needed
1560
### Removed
1661

62+
1763
## 5.6.0 - 2025.08.26
1864
### Added
1965
- More support for AND-Constraints

INSTALL.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ you need to specify the install location using the environment variable
3232
`set SCIPOPTDIR=<path_to_install_dir>` (**cmd**, **Cmder**, **WSL**)\
3333
`$Env:SCIPOPTDIR = "<path_to_install_dir>"` (**powershell**)
3434

35+
**Note:** If `SCIPOPTDIR` is not set, the setup script will automatically attempt to detect a conda environment (via the `CONDA_PREFIX` environment variable) and use it if available. If no conda environment is detected, it will fall back to searching global installation paths.
36+
3537
`SCIPOPTDIR` needs to have a subdirectory `lib` that contains the
3638
library, e.g. `libscip.so` (for Linux) and a subdirectory `include` that
3739
contains the corresponding header files:

LICENSE

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
MIT License
22

3-
Copyright (c) 2023 Zuse Institute Berlin (ZIB)
3+
Copyright (c) 2025 Zuse Institute Berlin (ZIB)
44

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
5+
Permission is hereby granted, free of charge, to any person btaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
116

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
148

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
10+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,23 @@ Please cite [this paper](https://opus4.kobv.de/opus4-zib/frontdoor/index/index/d
119119
}
120120
```
121121
as well as the corresponding [SCIP Optimization Suite report](https://scip.zib.de/index.php#cite) when you use this tool for a publication or other scientific work.
122+
123+
Seeking Maintainers
124+
----------------------------------
125+
126+
PySCIPOpt is sustained by volunteer effort, and as the project grows we are inviting more contributors and maintainers to join the team.
127+
128+
What needs to be done
129+
----------------------
130+
These are the core responsibilities:
131+
132+
* Community support: Going over the open issues regularly. Occasionally visiting Stack Overflow and OR.SE, as users also ask questions there.
133+
* PR review: Reviewing user pull requests, making sure that the CHANGELOG is updated, and all added methods are tested.
134+
* API coverage: keep expanding PySCIPOpt's coverage of SCIP's C API.
135+
* Documentation: help keep the documentation up to date, and add new tutorials/examples.
136+
* Releases: there should be a PySCIPOpt release with every SCIP release, at a minimum.
137+
138+
Even if you are not interested in becoming a maintainer, but would like to help out occasionally, that would be very welcome as well!
139+
140+
Send us an email over at **joao.goncalves.dionisio@gmail.com** if you're ready to take on the challenge :)
141+

0 commit comments

Comments
 (0)