Skip to content

Commit

Permalink
Merge pull request #257 from moorepants/scipy-regression
Browse files Browse the repository at this point in the history
Updated unit tests to call coo_array on 2d arrays not 1d arrays due to change in behavior in SciPy 1.13.
  • Loading branch information
moorepants authored Jun 7, 2024
2 parents 44536e2 + 8a3a28d commit 3ccda5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ jobs:
# Ipopt needed different libfortrans.
if: (matrix.ipopt-version != '3.12' && matrix.python-version != '3.11') || (matrix.ipopt-version != '3.12' && matrix.python-version != '3.10' && matrix.os != 'macos-latest')
run: |
mamba install -q -y -c conda-forge "ipopt=${{ matrix.ipopt-version }}" "numpy>=1.21.5" "pkg-config>=0.29.2" "setuptools>=44.1.1" "scipy>1.8.0,<1.13.0" "pytest>=6.2.5" "cython=0.29.*"
mamba install -q -y -c conda-forge "ipopt=${{ matrix.ipopt-version }}" "numpy>=1.21.5" "pkg-config>=0.29.2" "setuptools>=44.1.1" "scipy>1.8.0" "pytest>=6.2.5" "cython=0.29.*"
mamba list
pytest
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 3ccda5d

Please sign in to comment.