Skip to content

Commit

Permalink
Update fixtures for CVXPY v1.5.3 and NumPy v2 (#28)
Browse files Browse the repository at this point in the history
The Gurobi interface in CVXPY was fixed for NumPy v2 in
cvxpy/cvxpy#2484, released in v1.5.3.

It seems the formatting of sparse matrices changed, something to do with
the interaction between SciPy and NumPy v2. Not quite sure if this
change was intended or not 🤷
  • Loading branch information
jonathanberthias authored Aug 18, 2024
1 parent 577b7f5 commit 9983b5f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ build.hooks.vcs.version-file = "src/cvxpy_gurobi/_version.py"

[tool.hatch.envs.default]
dependencies = [
"cvxpy-base==1.5.2",
"gurobipy==11.0.0",
"numpy<2", # as of cvxpy 1.5.2, the gurobi interface is not compatible with numpy 2
"cvxpy-base==1.5.*",
"gurobipy==11.*",
"numpy",
"pytest",
"pytest-insta",
]
Expand All @@ -72,7 +72,7 @@ versions = [
dependencies = [
"cvxpy-base=={matrix:cvxpy}.*",
"gurobipy=={matrix:gurobipy}.*",
"numpy<2", # as of cvxpy 1.5.2, the gurobi interface is not compatible with numpy 2
"numpy",
"scipy{matrix:scipy:}",
"coverage[toml]",
"pytest",
Expand Down
4 changes: 2 additions & 2 deletions tests/snapshots/all__lp_matrix10__0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ CVXPY
Minimize
Sum(x, None, False)
Subject To
91: [[0.0 1.0]
[2.0 3.0]] @ x + y == 1.0
91: [[np.float64(0.0) np.float64(1.0)]
[np.float64(2.0) np.float64(3.0)]] @ x + y == 1.0
Bounds
x free
y free
Expand Down
4 changes: 2 additions & 2 deletions tests/snapshots/all__lp_matrix11__0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ CVXPY
Minimize
Sum(x, None, False)
Subject To
101: [[0.0 1.0]
[2.0 3.0]] @ x + y + Promote(1.0, (2,)) == 0.0
101: [[np.float64(0.0) np.float64(1.0)]
[np.float64(2.0) np.float64(3.0)]] @ x + y + Promote(1.0, (2,)) == 0.0
Bounds
x free
y free
Expand Down
4 changes: 2 additions & 2 deletions tests/snapshots/all__lp_matrix9__0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ CVXPY
Minimize
Sum(x, None, False)
Subject To
83: [[0.0 1.0]
[2.0 3.0]] @ x == 1.0
83: [[np.float64(0.0) np.float64(1.0)]
[np.float64(2.0) np.float64(3.0)]] @ x == 1.0
Bounds
x free
End
Expand Down
4 changes: 2 additions & 2 deletions tests/snapshots/all__lp_matrix_quadratic5__0.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CVXPY
Minimize
quad_over_lin([[2.0 0.0]
[0.0 2.0]] @ x, 1.0)
quad_over_lin([[np.float64(2.0) np.float64(0.0)]
[np.float64(0.0) np.float64(2.0)]] @ x, 1.0)
Subject To
Bounds
x free
Expand Down

0 comments on commit 9983b5f

Please sign in to comment.