From 0c09a4021d64ac2265730c503cff6a9e9a928917 Mon Sep 17 00:00:00 2001 From: Xiangyan Sun Date: Mon, 20 Apr 2026 01:29:02 -0700 Subject: [PATCH] Avoid implicit array -> scalar conversion in tests With numpy 2.4, it complains: TypeError: only 0-dimensional arrays can be converted to Python scalars --- .../scikits/odes/tests/test_user_return_vals_cvode.py | 2 +- .../scikits/odes/tests/test_user_return_vals_ida.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/scikits-odes/src/scikits/odes/tests/test_user_return_vals_cvode.py b/packages/scikits-odes/src/scikits/odes/tests/test_user_return_vals_cvode.py index 58fae63..8866fe3 100644 --- a/packages/scikits-odes/src/scikits/odes/tests/test_user_return_vals_cvode.py +++ b/packages/scikits-odes/src/scikits/odes/tests/test_user_return_vals_cvode.py @@ -8,7 +8,7 @@ def normal_rhs(t, y, ydot): ydot[0] = t def complex_rhs(t, y, ydot): - ydot[0] = t - y + ydot[0] = t - y[0] def rhs_with_return(t, y, ydot): ydot[0] = t diff --git a/packages/scikits-odes/src/scikits/odes/tests/test_user_return_vals_ida.py b/packages/scikits-odes/src/scikits/odes/tests/test_user_return_vals_ida.py index 0c38035..4ae4e70 100644 --- a/packages/scikits-odes/src/scikits/odes/tests/test_user_return_vals_ida.py +++ b/packages/scikits-odes/src/scikits/odes/tests/test_user_return_vals_ida.py @@ -5,17 +5,17 @@ from ..sundials.ida import StatusEnumIDA def normal_rhs(t, y, ydot, res): - res[0] = ydot - t + res[0] = ydot[0] - t def complex_rhs(t, y, ydot, res): - res[0] = ydot - t + y + res[0] = ydot[0] - t + y[0] def rhs_with_return(t, y, ydot, res): - res[0] = ydot - t + res[0] = ydot[0] - t return 0 def rhs_problem_late(t, y, ydot, res): - res[0] = ydot - t + res[0] = ydot[0] - t if t > 0.5: return 1 @@ -23,7 +23,7 @@ def rhs_problem_immediate(t, y, ydot, res): return 1 def rhs_error_late(t, y, ydot, res): - res[0] = ydot - t + res[0] = ydot[0] - t if t > 0.5: return -1