Unverified Commit 457f518f authored by Michael Daniels's avatar Michael Daniels Committed by GitHub
Browse files

python3Packages.scikits-odes{,-daepack}: fix build (#511691)

parents 9753660c 55fa17cb
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -30,6 +30,9 @@ buildPythonPackage rec {
  # no tests
  doCheck = false;

  # https://github.com/bmcage/odes/pull/204
  env.NIX_CFLAGS_COMPILE = "-std=gnu17";

  meta = scikits-odes-core.meta // {
    description = "Wrapper around daepack";
    homepage = "https://github.com/bmcage/odes/blob/master/packages/scikits-odes-daepack";
+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