Commit 55fa17cb authored by Xiangyan Sun's avatar Xiangyan Sun
Browse files

python3Packages.scikits-odes: fix tests

parent 66e5611b
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -17,6 +17,19 @@ buildPythonPackage rec {

  sourceRoot = "${src.name}/packages/scikits-odes";

  patches = [
    # https://github.com/bmcage/odes/pull/205
    ./numpy24-compat.patch
  ];

  postPatch = ''
    # scipy 1.17.x's rewritten VODE integrator have bugs such as:
    # https://github.com/scipy/scipy/issues/24933
    # revisit after new scipy release
    substituteInPlace src/scikits/odes/tests/test_dae.py \
      --replace-fail "StiffVODECompare," ""
  '';

  build-system = [ setuptools ];

  dependencies = [
+48 −0
Original line number Diff line number Diff line
diff --git a/src/scikits/odes/tests/test_user_return_vals_cvode.py b/src/scikits/odes/tests/test_user_return_vals_cvode.py
index 58fae63..8866fe3 100644
--- a/src/scikits/odes/tests/test_user_return_vals_cvode.py
+++ b/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/src/scikits/odes/tests/test_user_return_vals_ida.py b/src/scikits/odes/tests/test_user_return_vals_ida.py
index 0c38035..4ae4e70 100644
--- a/src/scikits/odes/tests/test_user_return_vals_ida.py
+++ b/src/scikits/odes/tests/test_user_return_vals_ida.py
@@ -5,17 +5,17 @@ from .. import dae
 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