From 23c0d1fb419a2eb7fdf4ee7c11ec1492c6c8c14b Mon Sep 17 00:00:00 2001 From: "Jason K. Moore" Date: Fri, 7 Jun 2024 12:59:06 +0200 Subject: [PATCH 1/2] Updated unit tests to call coo_array on 2d arrays not 1d arrays due to change in behavior in SciPy 1.13. --- cyipopt/tests/unit/test_scipy_optional.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cyipopt/tests/unit/test_scipy_optional.py b/cyipopt/tests/unit/test_scipy_optional.py index fbd0669..e318e32 100644 --- a/cyipopt/tests/unit/test_scipy_optional.py +++ b/cyipopt/tests/unit/test_scipy_optional.py @@ -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) @@ -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) From 8a3a28d43dbfe9513be9284b45f208e45e2060f8 Mon Sep 17 00:00:00 2001 From: "Jason K. Moore" Date: Fri, 7 Jun 2024 13:03:47 +0200 Subject: [PATCH 2/2] Remove scipy upper cap in CI. --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 16ef64b..4a9d519 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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