diff --git a/pkgs/applications/science/math/sage/patches/numpy-1.25-deprecation.patch b/pkgs/applications/science/math/sage/patches/numpy-1.25-deprecation.patch new file mode 100644 index 000000000000..539afc4b3b77 --- /dev/null +++ b/pkgs/applications/science/math/sage/patches/numpy-1.25-deprecation.patch @@ -0,0 +1,18 @@ +diff --git a/src/sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py b/src/sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py +index aa153fd4cd..eebbe87aff 100644 +--- a/src/sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py ++++ b/src/sage/tests/books/computational-mathematics-with-sagemath/graphique_doctest.py +@@ -134,11 +134,11 @@ Sage example in ./graphique.tex, line 1120:: + sage: t = srange(0, 5, 0.1); p = Graphics() + sage: for k in srange(0, 10, 0.15): + ....: y = integrate.odeint(f, k, t) +- ....: p += line(zip(t, flatten(y))) ++ ....: p += line(zip(t, y.flatten())) + sage: t = srange(0, -5, -0.1); q = Graphics() + sage: for k in srange(0, 10, 0.15): + ....: y = integrate.odeint(f, k, t) +- ....: q += line(zip(t, flatten(y))) ++ ....: q += line(zip(t, y.flatten())) + sage: y = var('y') + sage: v = plot_vector_field((1, -cos(x*y)), (x,-5,5), (y,-2,11)) + sage: g = p + q + v; g.show() diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index d890a65230cb..dee6e8eb0d4b 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -80,6 +80,23 @@ stdenv.mkDerivation rec { sha256 = "sha256-k8Oam+EiRcfXC7qCdLacCx+7vpUAw2K1wsjKcQbeGb4="; }) + # https://github.com/sagemath/sage/pull/35826, landed in 10.1.beta5 + (fetchpatch { + name = "numpy-1.25.0-upgrade.patch"; + url = "https://github.com/sagemath/sage/commit/ecfe06b8f1fe729b07e885f0de55244467e5c137.diff"; + sha256 = "sha256-G0xhl+LyNdDYPzRqSHK3fHaepcIzpuwmqRiussraDf0="; + }) + + # https://github.com/sagemath/sage/pull/35826#issuecomment-1658569891 + ./patches/numpy-1.25-deprecation.patch + + # https://github.com/sagemath/sage/pull/35842, landed in 10.1.beta5 + (fetchpatch { + name = "scipy-1.11-upgrade.patch"; + url = "https://github.com/sagemath/sage/commit/90ece168c3c61508baa36659b0027b7dd8b43add.diff"; + sha256 = "sha256-Y5TmuJcUJR+veb2AuSVODGs+xkVV+pTM8fWTm4q+NDs="; + }) + # https://github.com/sagemath/sage/pull/35825, landed in 10.1.beta6 (fetchpatch { name = "singular-4.3.2p2-upgrade.patch";