Skip to content

Commit d3b0fff

Browse files
committed
Merge branch 'master' into fix/1061
2 parents 88a935f + 73356c6 commit d3b0fff

File tree

13 files changed

+1425
-48
lines changed

13 files changed

+1425
-48
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
### Fixed
2626
- Raised an error when an expression is used when a variable is required
2727
- Fixed some compile warnings
28+
- Fixed the type of @ matrix operation result from MatrixVariable to MatrixExpr.
2829
### Changed
2930
- MatrixExpr.sum() now supports axis arguments and can return either a scalar or MatrixExpr, depending on the result dimensions.
3031
- AddMatrixCons() also accepts ExprCons.

pyproject.toml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,25 @@ version = {attr = "pyscipopt._version.__version__"}
3939
[tool.cibuildwheel]
4040
skip="pp*" # currently doesn't work with PyPy
4141
manylinux-x86_64-image = "manylinux_2_28"
42+
manylinux-aarch64-image = "manylinux_2_28"
4243

4344

4445
[tool.cibuildwheel.linux]
4546
skip="pp* cp36* cp37* *musllinux*"
46-
before-all = [
47-
"(apt-get update && apt-get install --yes wget) || yum install -y wget zlib libgfortran || brew install wget",
48-
"wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.7.0/libscip-linux.zip -O scip.zip",
49-
"unzip scip.zip",
50-
"mv scip_install scip"
51-
]
47+
before-all = '''
48+
#!/bin/bash
49+
(apt-get update && apt-get install --yes wget) || yum install -y wget zlib libgfortran || brew install wget
50+
AARCH=$(uname -m)
51+
echo "------"
52+
echo $AARCH
53+
if [[ $AARCH == "aarch64" ]]; then
54+
wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.8.0/libscip-linux-arm.zip -O scip.zip
55+
else
56+
wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.8.0/libscip-linux.zip -O scip.zip
57+
fi
58+
unzip scip.zip
59+
mv scip_install scip
60+
'''
5261
environment = { SCIPOPTDIR="$(pwd)/scip", LD_LIBRARY_PATH="$(pwd)/scip/lib:$LD_LIBRARY_PATH", DYLD_LIBRARY_PATH="$(pwd)/scip/lib:$DYLD_LIBRARY_PATH", PATH="$(pwd)/scip/bin:$PATH", PKG_CONFIG_PATH="$(pwd)/scip/lib/pkgconfig:$PKG_CONFIG_PATH", RELEASE="true"}
5362

5463

@@ -58,10 +67,10 @@ before-all = '''
5867
#!/bin/bash
5968
brew install wget zlib gcc
6069
if [[ $CIBW_ARCHS == *"arm"* ]]; then
61-
wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.7.0/libscip-macos-arm.zip -O scip.zip
70+
wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.8.0/libscip-macos-arm.zip -O scip.zip
6271
export MACOSX_DEPLOYMENT_TARGET=14.0
6372
else
64-
wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.7.0/libscip-macos-intel.zip -O scip.zip
73+
wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.8.0/libscip-macos-intel.zip -O scip.zip
6574
export MACOSX_DEPLOYMENT_TARGET=13.0
6675
fi
6776
unzip scip.zip
@@ -87,7 +96,7 @@ repair-wheel-command = '''
8796
skip="pp* cp36* cp37*"
8897
before-all = [
8998
"choco install 7zip wget",
90-
"wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.7.0/libscip-windows.zip -O scip.zip",
99+
"wget https://github.com/scipopt/scipoptsuite-deploy/releases/download/v0.8.0/libscip-windows.zip -O scip.zip",
91100
"\"C:\\Program Files\\7-Zip\\7z.exe\" x \"scip.zip\" -o\"scip-test\"",
92101
"mv .\\scip-test\\scip_install .\\test",
93102
"mv .\\test .\\scip"

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@
6262
extra_link_args.append(f"-Wl,-rpath,{libdir}")
6363

6464
# enable debug mode if requested
65-
if os.environ.get("PYSCIPOPT_DEBUG")=="True":
65+
if "--debug" in sys.argv:
6666
extra_compile_args.append("-UNDEBUG")
67+
sys.argv.remove("--debug")
6768

6869
use_cython = True
6970

@@ -109,7 +110,7 @@
109110

110111
setup(
111112
name="PySCIPOpt",
112-
version="5.5.0",
113+
version="5.6.0",
113114
description="Python interface and modeling environment for SCIP",
114115
long_description=long_description,
115116
long_description_content_type="text/markdown",

src/pyscipopt/__init__.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,38 @@
77
os.add_dll_directory(os.path.join(os.getenv('SCIPOPTDIR').strip('"'), 'bin'))
88

99
# export user-relevant objects:
10-
from pyscipopt.Multidict import multidict
11-
from pyscipopt.scip import Model
12-
from pyscipopt.scip import Variable
13-
from pyscipopt.scip import MatrixVariable
14-
from pyscipopt.scip import Constraint
15-
from pyscipopt.scip import MatrixConstraint
16-
from pyscipopt.scip import Benders
17-
from pyscipopt.scip import Benderscut
18-
from pyscipopt.scip import Branchrule
19-
from pyscipopt.scip import Nodesel
20-
from pyscipopt.scip import Conshdlr
21-
from pyscipopt.scip import Eventhdlr
22-
from pyscipopt.scip import Heur
23-
from pyscipopt.scip import Presol
24-
from pyscipopt.scip import Pricer
25-
from pyscipopt.scip import Prop
26-
from pyscipopt.scip import Reader
27-
from pyscipopt.scip import Sepa
28-
from pyscipopt.scip import LP
10+
from pyscipopt.Multidict import multidict as multidict
11+
from pyscipopt.scip import Model as Model
12+
from pyscipopt.scip import Variable as Variable
13+
from pyscipopt.scip import MatrixVariable as MatrixVariable
14+
from pyscipopt.scip import Constraint as Constraint
15+
from pyscipopt.scip import MatrixConstraint as MatrixConstraint
16+
from pyscipopt.scip import Benders as Benders
17+
from pyscipopt.scip import Benderscut as Benderscut
18+
from pyscipopt.scip import Branchrule as Branchrule
19+
from pyscipopt.scip import Nodesel as Nodesel
20+
from pyscipopt.scip import Conshdlr as Conshdlr
21+
from pyscipopt.scip import Eventhdlr as Eventhdlr
22+
from pyscipopt.scip import Heur as Heur
23+
from pyscipopt.scip import Presol as Presol
24+
from pyscipopt.scip import Pricer as Pricer
25+
from pyscipopt.scip import Prop as Prop
26+
from pyscipopt.scip import Reader as Reader
27+
from pyscipopt.scip import Sepa as Sepa
28+
from pyscipopt.scip import LP as LP
2929
from pyscipopt.scip import PY_SCIP_LPPARAM as SCIP_LPPARAM
30-
from pyscipopt.scip import readStatistics
31-
from pyscipopt.scip import Expr
32-
from pyscipopt.scip import MatrixExpr
33-
from pyscipopt.scip import MatrixExprCons
34-
from pyscipopt.scip import ExprCons
35-
from pyscipopt.scip import quicksum
36-
from pyscipopt.scip import quickprod
37-
from pyscipopt.scip import exp
38-
from pyscipopt.scip import log
39-
from pyscipopt.scip import sqrt
40-
from pyscipopt.scip import sin
41-
from pyscipopt.scip import cos
30+
from pyscipopt.scip import readStatistics as readStatistics
31+
from pyscipopt.scip import Expr as Expr
32+
from pyscipopt.scip import MatrixExpr as MatrixExpr
33+
from pyscipopt.scip import MatrixExprCons as MatrixExprCons
34+
from pyscipopt.scip import ExprCons as ExprCons
35+
from pyscipopt.scip import quicksum as quicksum
36+
from pyscipopt.scip import quickprod as quickprod
37+
from pyscipopt.scip import exp as exp
38+
from pyscipopt.scip import log as log
39+
from pyscipopt.scip import sqrt as sqrt
40+
from pyscipopt.scip import sin as sin
41+
from pyscipopt.scip import cos as cos
4242
from pyscipopt.scip import PY_SCIP_RESULT as SCIP_RESULT
4343
from pyscipopt.scip import PY_SCIP_PARAMSETTING as SCIP_PARAMSETTING
4444
from pyscipopt.scip import PY_SCIP_PARAMEMPHASIS as SCIP_PARAMEMPHASIS

src/pyscipopt/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '5.5.0'
1+
__version__: str = '5.6.0'

src/pyscipopt/matrix.pxi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ class MatrixExpr(np.ndarray):
9090

9191
def __rsub__(self, other):
9292
return super().__rsub__(other).view(MatrixExpr)
93-
93+
94+
def __matmul__(self, other):
95+
return super().__matmul__(other).view(MatrixExpr)
96+
9497
class MatrixGenExpr(MatrixExpr):
9598
pass
9699

src/pyscipopt/py.typed

Whitespace-only changes.

src/pyscipopt/recipes/infeasibilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pyscipopt import Model, quicksum
22

33

4-
def get_infeasible_constraints(orig_model: Model, verbose=False):
4+
def get_infeasible_constraints(orig_model: Model, verbose: bool = False):
55
"""
66
Given a model, adds slack variables to all the constraints and minimizes a binary variable that indicates if they're positive.
77
Positive slack variables correspond to infeasible constraints.

src/pyscipopt/recipes/nonlinear.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pyscipopt import Model
22

3-
def set_nonlinear_objective(model: Model, expr, sense="minimize"):
3+
def set_nonlinear_objective(model: Model, expr, sense: str = "minimize"):
44
"""
55
Takes a nonlinear expression and performs an epigraph reformulation.
66
"""

src/pyscipopt/scip.pxi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,8 +2509,8 @@ cdef class _VarArray:
25092509
else:
25102510
raise TypeError(f"Expected Variable or list of Variable, got {type(vars)}.")
25112511

2512-
if vars:
2513-
self.size = len(vars)
2512+
self.size = len(vars)
2513+
if self.size:
25142514
self.ptr = <SCIP_VAR**> malloc(self.size * sizeof(SCIP_VAR*))
25152515
for i, var in enumerate(vars):
25162516
if not isinstance(var, Variable):
@@ -11870,6 +11870,9 @@ def readStatistics(filename):
1187011870

1187111871
seen_cons = 0
1187211872
for i, line in enumerate(data):
11873+
if line == "\n":
11874+
continue
11875+
1187311876
split_line = line.split(":")
1187411877
split_line[1] = split_line[1][:-1] # removing \n
1187511878
stat_name = split_line[0].strip()

0 commit comments

Comments
 (0)