Skip to content

Commit

Permalink
Updated unit tests to call coo_array on 2d arrays not 1d arrays due t…
Browse files Browse the repository at this point in the history
…o change in behavior in SciPy 1.13.
  • Loading branch information
moorepants committed Jun 7, 2024
1 parent e0ccaf7 commit 23c0d1f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cyipopt/tests/unit/test_scipy_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,12 +400,12 @@ def grad(x):
con_eq = {
"type": "eq",
"fun": lambda x: np.sum(x**2) - 40,
"jac": lambda x: coo_array(2 * x)
"jac": lambda x: coo_array([2 * x])
}
con_ineq = {
"type": "ineq",
"fun": lambda x: np.prod(x) - 25,
"jac": lambda x: coo_array(np.prod(x) / x),
"jac": lambda x: coo_array([np.prod(x) / x]),
}
constrs = (con_eq, con_ineq)

Expand Down Expand Up @@ -460,7 +460,7 @@ def grad(x):
con_ineq_sparse = {
"type": "ineq",
"fun": lambda x: np.prod(x) - 25,
"jac": lambda x: coo_array(np.prod(x) / x),
"jac": lambda x: coo_array([np.prod(x) / x]),
}
constrs = (con_eq_dense, con_ineq_sparse)

Expand Down

0 comments on commit 23c0d1f

Please sign in to comment.