Skip to content

Commit 769db47

Browse files
fschloesserKsenia BestuzhevaChristoph Graczykjurgen-lentz
authored
Scip 8 (#553)
* Getting the update for new cons_nonlinear started * Changed names of most of the consexpr functions, added todos for relevant deletions and open problems in the current implementation. * fixed addQuadCons, _addNonlinearCons, chgLhs, chgRhs, WIP _addGenNonlinearCons, removed isQuadratic(), added a couple of new expr functions from scip8 * A few fixes for the nonlinear interface * change recommended scip version and fix sepa warnings (#540) * added printCons function and added print to test nlrow * Fixing test_nlrow (in progress) * removed getQuadraticTerms for NLRows in SCIP8 * Debugging test_nonlinear * Fixed the rest of test_nonlinear * fixed test_gastrans solution precision * add mac test for pyscipopt install without py.test * SCIP 8.0.0 (#551) * update github actions and pyscipopt version * Update version to 4.0.0 * add bison to macos test * added new requirements for scip8 * move table from install to readme * update setup.py Co-authored-by: Ksenia Bestuzheva <[email protected]> Co-authored-by: Christoph Graczyk <[email protected]> Co-authored-by: Jurgen Lentz <[email protected]>
1 parent c554beb commit 769db47

13 files changed

+418
-392
lines changed

.github/workflows/integration-test.yml

+54-54
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Integration test
22

33
env:
4-
version: 7.0.3
4+
version: 8.0.0
55

66
# runs on branches and pull requests; doesn't run on tags.
77
on:
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414

1515
Integration-test:
16-
runs-on: ubuntu-18.04
16+
runs-on: ubuntu-20.04
1717
strategy:
1818
fail-fast: true
1919
matrix:
@@ -83,58 +83,58 @@ jobs:
8383
run: |
8484
py.test
8585
86-
# MacOS-test:
87-
# runs-on: macos-latest
88-
# strategy:
89-
# matrix:
90-
# python-version: [3.8, 3.9]
91-
# steps:
92-
# - uses: actions/checkout@v2
93-
#
94-
# - name: Cache dependencies (SCIPOptSuite)
95-
# id: cache-scip
96-
# uses: actions/cache@v2
97-
# with:
98-
# path: |
99-
# ${{ runner.workspace }}/scipoptsuite
100-
# ~/Library/Caches/Homebrew/tbb@2020--*
101-
# /usr/local/opt/tbb@2020*
102-
# ~/Library/Caches/Homebrew/downloads/*--tbb@2020-*
103-
# ~/Library/Caches/Homebrew/boost--*
104-
# /usr/local/opt/boost*
105-
# ~/Library/Caches/Homebrew/downloads/*--boost-*
106-
# key: ${{ runner.os }}-scipopt-${{ env.version }}-${{ hashFiles('**/lockfiles') }}
107-
# restore-keys: |
108-
# ${{ runner.os }}-scipopt-${{ env.version }}-
109-
#
110-
# - name: Install dependencies (SCIPOptSuite)
111-
# if: steps.cache-scip.outputs.cache-hit != 'true'
112-
# run: |
113-
# brew install tbb@2020 boost
114-
# wget --quiet --no-check-certificate https://scipopt.org/download/release/scipoptsuite-${{ env.version }}.tgz
115-
# tar xfz scipoptsuite-${{ env.version }}.tgz
116-
# cd scipoptsuite-${{ env.version }}
117-
# mkdir build
118-
# cd build
119-
# cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/scipoptsuite -DIPOPT=off -DSYM=none -DTPI=tny -DREADLINE=off -DTBB_LIBRARY_DIR=/usr/local/opt/tbb@2020/lib
120-
# make install -j
121-
#
122-
# - name: Setup python ${{ matrix.python-version }}
123-
# uses: actions/setup-python@v2
124-
# with:
125-
# python-version: ${{ matrix.python-version }}
126-
#
127-
# - name: Prepare python environment
128-
# run: |
129-
# python -m pip install --upgrade pip
130-
# python -m pip install wheel cython networkx pytest-cov pytest
131-
#
132-
# - name: Install PySCIPOpt
133-
# run: |
134-
# export SCIPOPTDIR=${{ runner.workspace }}/scipoptsuite/
135-
# export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${{ runner.workspace }}/scipoptsuite/lib
136-
# python -m pip install .
137-
#
86+
MacOS-test:
87+
runs-on: macos-latest
88+
strategy:
89+
matrix:
90+
python-version: [3.8, 3.9]
91+
steps:
92+
- uses: actions/checkout@v2
93+
94+
- name: Cache dependencies (SCIPOptSuite)
95+
id: cache-scip
96+
uses: actions/cache@v2
97+
with:
98+
path: |
99+
${{ runner.workspace }}/scipoptsuite
100+
~/Library/Caches/Homebrew/tbb@2020--*
101+
/usr/local/opt/tbb@2020*
102+
~/Library/Caches/Homebrew/downloads/*--tbb@2020-*
103+
~/Library/Caches/Homebrew/boost--*
104+
/usr/local/opt/boost*
105+
~/Library/Caches/Homebrew/downloads/*--boost-*
106+
key: ${{ runner.os }}-scipopt-${{ env.version }}-${{ hashFiles('**/lockfiles') }}
107+
restore-keys: |
108+
${{ runner.os }}-scipopt-${{ env.version }}-
109+
110+
- name: Install dependencies (SCIPOptSuite)
111+
if: steps.cache-scip.outputs.cache-hit != 'true'
112+
run: |
113+
brew install tbb@2020 boost bison
114+
wget --quiet --no-check-certificate https://scipopt.org/download/release/scipoptsuite-${{ env.version }}.tgz
115+
tar xfz scipoptsuite-${{ env.version }}.tgz
116+
cd scipoptsuite-${{ env.version }}
117+
mkdir build
118+
cd build
119+
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/scipoptsuite -DIPOPT=off -DSYM=none -DTPI=tny -DREADLINE=off -DTBB_LIBRARY_DIR=/usr/local/opt/tbb@2020/lib
120+
make install -j
121+
122+
- name: Setup python ${{ matrix.python-version }}
123+
uses: actions/setup-python@v2
124+
with:
125+
python-version: ${{ matrix.python-version }}
126+
127+
- name: Prepare python environment
128+
run: |
129+
python -m pip install --upgrade pip
130+
python -m pip install wheel cython networkx pytest-cov pytest
131+
132+
- name: Install PySCIPOpt
133+
run: |
134+
export SCIPOPTDIR=${{ runner.workspace }}/scipoptsuite/
135+
export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:${{ runner.workspace }}/scipoptsuite/lib
136+
python -m pip install .
137+
138138
# - name: Run pyscipopt tests
139139
# run: |
140140
# export SCIPOPTDIR=${{ runner.workspace }}/scipoptsuite/

.github/workflows/test-release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: TestPyPI release
22

33
env:
4-
version: 7.0.3
4+
version: 8.0.0
55

66

77
# runs only when a release is published, not on drafts
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
deploy-packges-and-generate-documentation:
14-
runs-on: ubuntu-18.04
14+
runs-on: ubuntu-20.04
1515
steps:
1616
- uses: actions/checkout@v2
1717

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Test and Release PyPI Package
22

33
env:
4-
version: 7.0.3
4+
version: 8.0.0
55

66

77
# runs only when a release is published, not on drafts
@@ -28,7 +28,7 @@ jobs:
2828
2929
release-integration-test:
3030
needs: check-tag
31-
runs-on: ubuntu-18.04
31+
runs-on: ubuntu-20.04
3232
strategy:
3333
fail-fast: true
3434
matrix:
@@ -100,7 +100,7 @@ jobs:
100100
101101
deploy-packages-and-generate-documentation:
102102
needs: Windows-test
103-
runs-on: ubuntu-18.04
103+
runs-on: ubuntu-20.04
104104
steps:
105105
- uses: actions/checkout@v2
106106

INSTALL.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,7 @@ Requirements
44
PySCIPOpt requires a working installation of the [SCIP Optimization
55
Suite](https://www.scipopt.org/). Please, make sure that your SCIP installation works!
66

7-
Note that the latest PySCIPOpt version is usually only compatible with the latest major release of the SCIP Optimization Suite.
8-
The following table summarizes which version of PySCIPOpt is required for a given SCIP version:
9-
10-
|SCIP| PySCIPOpt |
11-
|----|----|
12-
7.0 | 3.x
13-
6.0 | 2.x
14-
5.0 | 1.4, 1.3
15-
4.0 | 1.2, 1.1
16-
3.2 | 1.0
7+
**Note that the latest PySCIPOpt version is usually only compatible with the latest major release of the SCIP Optimization Suite. See the table on the README.md page for details.**
178

189
If SCIP is not installed in the global path
1910
you need to specify the install location using the environment variable

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,17 @@ conda install --channel conda-forge pyscipopt
3434

3535
See [INSTALL.md](INSTALL.md) for instructions.
3636
Please note that the latest PySCIPOpt version is usually only compatible with the latest major release of the SCIP Optimization Suite.
37+
The following table summarizes which version of PySCIPOpt is required for a given SCIP version:
38+
39+
|SCIP| PySCIPOpt |
40+
|----|----|
41+
8.0 | 4.x
42+
7.0 | 3.x
43+
6.0 | 2.x
44+
5.0 | 1.4, 1.3
45+
4.0 | 1.2, 1.1
46+
3.2 | 1.0
47+
3748
Information which version of PySCIPOpt is required for a given SCIP version can also be found in [INSTALL.md](INSTALL.md).
3849

3950
Building and solving a model

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
print('Using include path <%s>.' % includedir)
1919

2020
# determine library
21-
if os.path.exists(os.path.join(scipoptdir, 'lib/shared/libscipsolver.so')):
21+
if os.path.exists(os.path.join(scipoptdir, 'lib/shared/libscip.so')):
2222
# SCIP seems to be created with make
2323
libdir = os.path.abspath(os.path.join(scipoptdir, 'lib/shared'))
24-
libname = 'scipsolver'
24+
libname = 'scip'
2525
extra_compile_args.append('-DNO_CONFIG_HEADER')
2626
else:
2727
# assume that SCIP is installed on the system

src/pyscipopt/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '3.5.0'
1+
__version__ = '4.0.0'
22

33
# required for Python 3.8 on Windows
44
import os

src/pyscipopt/expr.pxi

-25
Original file line numberDiff line numberDiff line change
@@ -381,24 +381,6 @@ class Op:
381381
add = 'sum'
382382
prod = 'prod'
383383
fabs = 'abs'
384-
operatorIndexDic={
385-
varidx:SCIP_EXPR_VARIDX,
386-
const:SCIP_EXPR_CONST,
387-
plus:SCIP_EXPR_PLUS,
388-
minus:SCIP_EXPR_MINUS,
389-
mul:SCIP_EXPR_MUL,
390-
div:SCIP_EXPR_DIV,
391-
sqrt:SCIP_EXPR_SQRT,
392-
power:SCIP_EXPR_REALPOWER,
393-
exp:SCIP_EXPR_EXP,
394-
log:SCIP_EXPR_LOG,
395-
fabs:SCIP_EXPR_ABS,
396-
add:SCIP_EXPR_SUM,
397-
prod:SCIP_EXPR_PRODUCT
398-
}
399-
def getOpIndex(self, op):
400-
'''returns operator index'''
401-
return Op.operatorIndexDic[op];
402384

403385
Operator = Op()
404386

@@ -411,7 +393,6 @@ Operator = Op()
411393
#
412394
#See also the @ref ExprDetails "description" in the expr.pxi.
413395
cdef class GenExpr:
414-
cdef public operatorIndex
415396
cdef public _op
416397
cdef public children
417398

@@ -588,7 +569,6 @@ cdef class SumExpr(GenExpr):
588569
self.coefs = []
589570
self.children = []
590571
self._op = Operator.add
591-
self.operatorIndex = Operator.operatorIndexDic[self._op]
592572
def __repr__(self):
593573
return self._op + "(" + str(self.constant) + "," + ",".join(map(lambda child : child.__repr__(), self.children)) + ")"
594574

@@ -599,7 +579,6 @@ cdef class ProdExpr(GenExpr):
599579
self.constant = 1.0
600580
self.children = []
601581
self._op = Operator.prod
602-
self.operatorIndex = Operator.operatorIndexDic[self._op]
603582
def __repr__(self):
604583
return self._op + "(" + str(self.constant) + "," + ",".join(map(lambda child : child.__repr__(), self.children)) + ")"
605584

@@ -609,7 +588,6 @@ cdef class VarExpr(GenExpr):
609588
def __init__(self, var):
610589
self.children = [var]
611590
self._op = Operator.varidx
612-
self.operatorIndex = Operator.operatorIndexDic[self._op]
613591
def __repr__(self):
614592
return self.children[0].__repr__()
615593

@@ -620,7 +598,6 @@ cdef class PowExpr(GenExpr):
620598
self.expo = 1.0
621599
self.children = []
622600
self._op = Operator.power
623-
self.operatorIndex = Operator.operatorIndexDic[self._op]
624601
def __repr__(self):
625602
return self._op + "(" + self.children[0].__repr__() + "," + str(self.expo) + ")"
626603

@@ -630,7 +607,6 @@ cdef class UnaryExpr(GenExpr):
630607
self.children = []
631608
self.children.append(expr)
632609
self._op = op
633-
self.operatorIndex = Operator.operatorIndexDic[op]
634610
def __repr__(self):
635611
return self._op + "(" + self.children[0].__repr__() + ")"
636612

@@ -640,7 +616,6 @@ cdef class Constant(GenExpr):
640616
def __init__(self,number):
641617
self.number = number
642618
self._op = Operator.const
643-
self.operatorIndex = Operator.operatorIndexDic[self._op]
644619

645620
def __repr__(self):
646621
return str(self.number)

0 commit comments

Comments
 (0)