From 597f1cd1c46ffb92c3e0145de0071545a4c64865 Mon Sep 17 00:00:00 2001
From: Andy Tai <atai@atai.org>
Date: Fri, 1 Dec 2023 22:43:43 -0800
Subject: gnu: octave: Update to 8.4.0

* gnu/packages/maths.scm (octave-cli): Update to 8.4.0

Change-Id: I88fe31a25a3fbfc28985f5f0b51cb042369f4462
Signed-off-by: Eric Bavier <bavier@posteo.net>
---
 gnu/packages/maths.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'gnu/packages/maths.scm')

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 246f189115..386fb30cd9 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2917,7 +2917,7 @@ can solve two kinds of problems:
 (define-public octave-cli
   (package
     (name "octave-cli")
-    (version "8.3.0")
+    (version "8.4.0")
     (source
      (origin
        (method url-fetch)
@@ -2925,7 +2925,7 @@ can solve two kinds of problems:
                            version ".tar.xz"))
        (sha256
         (base32
-         "1aav8i88y2yl11g5d44wpjngkpldvzk90ja7wghkb91cy2a9974i"))))
+         "1a58zyrl1lx6b6wr2jbf6w806vjxr3jzbh6n85iinag47qxdg6kg"))))
     (build-system gnu-build-system)
     (inputs
      (list alsa-lib
-- 
cgit 1.4.1


From be73e08ba2fd8e9280840f8fa962e9821ba5b71e Mon Sep 17 00:00:00 2001
From: Felix Gruber <felgru@posteo.net>
Date: Sat, 4 Nov 2023 15:02:36 +0000
Subject: gnu: Add python-accupy.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/maths.scm (python-accupy): New variable.
* gnu/packages/patches/python-accupy-fix-use-of-perfplot.patch: New
  file.
* gnu/packages/patches/python-accupy-use-matplotx.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add new patch files.

Change-Id: I0222665d54a36830844b3b33e3dcb546741cfaa1
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/local.mk                                       |   4 +-
 gnu/packages/maths.scm                             |  41 ++++++++
 .../python-accupy-fix-use-of-perfplot.patch        |  48 +++++++++
 .../patches/python-accupy-use-matplotx.patch       | 113 +++++++++++++++++++++
 4 files changed, 205 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/python-accupy-fix-use-of-perfplot.patch
 create mode 100644 gnu/packages/patches/python-accupy-use-matplotx.patch

(limited to 'gnu/packages/maths.scm')

diff --git a/gnu/local.mk b/gnu/local.mk
index 063262eefd..5df953272c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -31,7 +31,7 @@
 # Copyright © 2020 R Veera Kumar <vkor@vkten.in>
 # Copyright © 2020 Nicolò Balzarotti <nicolo@nixo.xyz>
 # Copyright © 2020 Michael Rohleder <mike@rohleder.de>
-# Copyright © 2020, 2021, 2022 Felix Gruber <felgru@posteo.net>
+# Copyright © 2020, 2021, 2022, 2023 Felix Gruber <felgru@posteo.net>
 # Copyright © 2020 Ryan Prior <rprior@protonmail.com>
 # Copyright © 2020 Jan Wielkiewicz <tona_kosmicznego_smiecia@interia.pl>
 # Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
@@ -1761,6 +1761,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/prusa-slicer-fix-tests.patch		\
   %D%/packages/patches/prusa-slicer-with-cereal-1.3.1.patch	\
   %D%/packages/patches/pthreadpool-system-libraries.patch	\
+  %D%/packages/patches/python-accupy-use-matplotx.patch		\
+  %D%/packages/patches/python-accupy-fix-use-of-perfplot.patch	\
   %D%/packages/patches/python-chai-drop-python2.patch		\
   %D%/packages/patches/python-docrepr-fix-tests.patch		\
   %D%/packages/patches/python-feedparser-missing-import.patch	\
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 386fb30cd9..2769c4f6ec 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -3650,6 +3650,47 @@ Cassowary solver with typical use cases gaining a 40x improvement.  Memory
 savings are consistently > 5x.")
     (license license:bsd-3)))
 
+(define-public python-accupy
+  (package
+    (name "python-accupy")
+    (version "0.3.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/diego-hayashi/accupy")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0sxkwpp2xy2jgakhdxr4nh1cspqv8l89kz6s832h05pbpyc0n767"))
+       (patches (search-patches "python-accupy-use-matplotx.patch"
+                                "python-accupy-fix-use-of-perfplot.patch"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'set-eigen-include-dir
+            (lambda _
+              (substitute* "setup.py"
+                (("include_dirs=\\[\"\\/usr\\/include\\/eigen3\\/\"\\]," _)
+                 (string-append "include_dirs=[\""
+                                #$(file-append (this-package-input "eigen")
+                                             "/include/eigen3/")
+                                "\"],"))))))))
+    (propagated-inputs (list eigen python-mpmath python-pyfma))
+    (native-inputs (list pybind11
+                         python-matplotx
+                         python-perfplot
+                         python-pytest))
+    (home-page "https://github.com/diego-hayashi/accupy")
+    (synopsis "Accurate calculation of sums and dot products")
+    (description
+      "@code{accupy} is a Python library for accurately computing sums
+and (dot) products.  It implements Kahan summation, Shewchuck's
+algorithm and summation in K-fold precision.")
+    (license license:gpl3+)))
+
 (define-public slepc
   (package
     (name "slepc")
diff --git a/gnu/packages/patches/python-accupy-fix-use-of-perfplot.patch b/gnu/packages/patches/python-accupy-fix-use-of-perfplot.patch
new file mode 100644
index 0000000000..5b874e0056
--- /dev/null
+++ b/gnu/packages/patches/python-accupy-fix-use-of-perfplot.patch
@@ -0,0 +1,48 @@
+From 567558a4eb9b73ab30f9e469b36091eccf445f80 Mon Sep 17 00:00:00 2001
+From: Felix Gruber <felgru@posteo.net>
+Date: Sun, 23 Apr 2023 16:48:59 +0200
+Subject: [PATCH] Fix use of perfplot.
+
+data tuples are unpacked by perfplot before it calls the kernel
+functions.
+---
+ tests/test_dot.py | 16 ++++++++--------
+ 1 file changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/tests/test_dot.py b/tests/test_dot.py
+index a8160fe..51307ad 100644
+--- a/tests/test_dot.py
++++ b/tests/test_dot.py
+@@ -76,10 +76,10 @@ def test_speed_comparison1(n_range=None):
+     perfplot.plot(
+         setup=lambda n: (np.random.rand(n, 100), np.random.rand(100, n)),
+         kernels=[
+-            lambda xy: np.dot(*xy),
+-            lambda xy: accupy.kdot(*xy, K=2),
+-            lambda xy: accupy.kdot(*xy, K=3),
+-            lambda xy: accupy.fdot(*xy),
++            lambda x, y: np.dot(x, y),
++            lambda x, y: accupy.kdot(x, y, K=2),
++            lambda x, y: accupy.kdot(x, y, K=3),
++            lambda x, y: accupy.fdot(x, y),
+         ],
+         labels=["np.dot", "accupy.kdot[2]", "accupy.kdot[3]", "accupy.fdot"],
+         n_range=n_range,
+@@ -96,10 +96,10 @@ def test_speed_comparison2(n_range=None):
+     perfplot.plot(
+         setup=lambda n: (np.random.rand(100, n), np.random.rand(n, 100)),
+         kernels=[
+-            lambda xy: np.dot(*xy),
+-            lambda xy: accupy.kdot(*xy, K=2),
+-            lambda xy: accupy.kdot(*xy, K=3),
+-            lambda xy: accupy.fdot(*xy),
++            lambda x, y: np.dot(x, y),
++            lambda x, y: accupy.kdot(x, y, K=2),
++            lambda x, y: accupy.kdot(x, y, K=3),
++            lambda x, y: accupy.fdot(x, y),
+         ],
+         labels=["np.dot", "accupy.kdot[2]", "accupy.kdot[3]", "accupy.fdot"],
+         n_range=n_range,
+-- 
+2.39.2
+
diff --git a/gnu/packages/patches/python-accupy-use-matplotx.patch b/gnu/packages/patches/python-accupy-use-matplotx.patch
new file mode 100644
index 0000000000..f3dd17da22
--- /dev/null
+++ b/gnu/packages/patches/python-accupy-use-matplotx.patch
@@ -0,0 +1,113 @@
+From 1da1ed24cfba8a051b6c2f452a67ebfee77ca040 Mon Sep 17 00:00:00 2001
+From: Felix Gruber <felgru@posteo.net>
+Date: Sun, 23 Apr 2023 15:42:19 +0200
+Subject: [PATCH] Use dufte style from matplotx.
+
+The stand-alone dufte package has been deprecated in favor of the dufte
+style that has been integrated into matplotx.
+---
+ tests/test_dot.py  | 10 +++++-----
+ tests/test_sums.py | 12 ++++++------
+ tox.ini            |  2 +-
+ 3 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/tests/test_dot.py b/tests/test_dot.py
+index 0a40a0c..a8160fe 100644
+--- a/tests/test_dot.py
++++ b/tests/test_dot.py
+@@ -1,5 +1,5 @@
+-import dufte
+ import matplotlib.pyplot as plt
++import matplotx
+ import numpy as np
+ import perfplot
+ import pytest
+@@ -33,7 +33,7 @@ def test_fdot(cond):
+ 
+ 
+ def test_accuracy_comparison_illcond(target_cond=None):
+-    plt.style.use(dufte.style)
++    plt.style.use(matplotx.styles.dufte)
+ 
+     if target_cond is None:
+         target_cond = [10 ** k for k in range(2)]
+@@ -61,13 +61,13 @@ def test_accuracy_comparison_illcond(target_cond=None):
+     for label, d in zip(labels, data.T):
+         plt.loglog(condition_numbers, d, label=label)
+ 
+-    dufte.legend()
++    matplotx.line_labels()
+     plt.xlabel("condition number")
+-    dufte.ylabel("relative error")
++    matplotx.ylabel_top("relative error")
+ 
+ 
+ def test_speed_comparison1(n_range=None):
+-    plt.style.use(dufte.style)
++    plt.style.use(matplotx.styles.dufte)
+ 
+     if n_range is None:
+         n_range = [2 ** k for k in range(2)]
+diff --git a/tests/test_sums.py b/tests/test_sums.py
+index 1c0f6b0..8cd9ddb 100644
+--- a/tests/test_sums.py
++++ b/tests/test_sums.py
+@@ -1,5 +1,5 @@
+-import dufte
+ import matplotlib.pyplot as plt
++import matplotx
+ import numpy as np
+ import perfplot
+ import pytest
+@@ -32,7 +32,7 @@ def test_fsum(cond):
+ 
+ 
+ def test_accuracy_comparison_illcond(target_conds=None):
+-    plt.style.use(dufte.style)
++    plt.style.use(matplotx.styles.dufte)
+ 
+     if target_conds is None:
+         target_conds = [10 ** k for k in range(1, 2)]
+@@ -71,14 +71,14 @@ def test_accuracy_comparison_illcond(target_conds=None):
+     for label, color, d in zip(labels, colors, data.T):
+         plt.loglog(condition_numbers, d, label=label, color=color)
+ 
+-    dufte.legend()
++    matplotx.line_labels()
+     plt.xlabel("condition number")
+-    dufte.ylabel("relative error")
++    matplotx.ylabel_top("relative error")
+     # plt.gca().set_aspect(1.3)
+ 
+ 
+ def test_speed_comparison1(n_range=None):
+-    plt.style.use(dufte.style)
++    plt.style.use(matplotx.styles.dufte)
+ 
+     if n_range is None:
+         n_range = [2 ** k for k in range(2)]
+@@ -109,7 +109,7 @@ def test_speed_comparison1(n_range=None):
+ 
+ 
+ def test_speed_comparison2(n_range=None):
+-    plt.style.use(dufte.style)
++    plt.style.use(matplotx.styles.dufte)
+ 
+     if n_range is None:
+         n_range = [2 ** k for k in range(2)]
+diff --git a/tox.ini b/tox.ini
+index 79a53ec..524b3bc 100644
+--- a/tox.ini
++++ b/tox.ini
+@@ -4,7 +4,7 @@ isolated_build = True
+ 
+ [testenv]
+ deps =
+-    dufte
++    matplotx
+     perfplot
+     pytest
+     pytest-cov
+-- 
+2.39.2
+
-- 
cgit 1.4.1


From eede7fe00b0ab257281a526fa51ced266fbf5493 Mon Sep 17 00:00:00 2001
From: Felix Gruber <felgru@posteo.net>
Date: Sat, 4 Nov 2023 15:02:37 +0000
Subject: gnu: Add python-ndim.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/maths.scm (python-ndim): New variable.

Change-Id: I543f1f5e195f4f2fd5bd70f9ce29ec750a24439b
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/packages/maths.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

(limited to 'gnu/packages/maths.scm')

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 2769c4f6ec..c13be6feb1 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -164,6 +164,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-build)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
@@ -3691,6 +3692,30 @@ and (dot) products.  It implements Kahan summation, Shewchuck's
 algorithm and summation in K-fold precision.")
     (license license:gpl3+)))
 
+(define-public python-ndim
+  (package
+    (name "python-ndim")
+    (version "0.1.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/diego-hayashi/ndim")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1hri82k7pcpw9dns8l1f2asa3dm7hjv71wnxi3752258ia2qa44v"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs (list python-sympy))
+    (native-inputs (list python-flit-core python-pytest))
+    (home-page "https://github.com/diego-hayashi/ndim")
+    (synopsis "Multidimensional volumes and monomial integrals")
+    (description
+      "@code{ndim} computes all kinds of volumes and integrals of
+monomials over such volumes in a fast, numerically stable way, using
+recurrence relations.")
+    (license license:gpl3+)))
+
 (define-public slepc
   (package
     (name "slepc")
-- 
cgit 1.4.1


From d3ed7bb5e311502d43ccca95ef9032dcde76c911 Mon Sep 17 00:00:00 2001
From: Felix Gruber <felgru@posteo.net>
Date: Sat, 4 Nov 2023 15:02:38 +0000
Subject: gnu: Add python-orthopy.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/maths.scm (python-orthopy): New variable.

Change-Id: I75e528f30d285666b8012a9cbc5cbb7e28aaf764
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/packages/maths.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

(limited to 'gnu/packages/maths.scm')

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index c13be6feb1..9363c536c2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -174,6 +174,7 @@
   #:use-module (gnu packages scheme)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages shells)
+  #:use-module (gnu packages simulation)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages sqlite)
   #:use-module (gnu packages swig)
@@ -3716,6 +3717,47 @@ monomials over such volumes in a fast, numerically stable way, using
 recurrence relations.")
     (license license:gpl3+)))
 
+(define-public python-orthopy
+  (package
+    (name "python-orthopy")
+    (version "0.9.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/diego-hayashi/orthopy")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "00s2rwjdlq38zkf7wl1gvm2aw057r30266lkzfxkrfzr4i705xnq"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs
+      (list python-importlib-metadata
+            python-ndim
+            python-numpy
+            python-sympy))
+    (native-inputs (list ;python-cplot  ;only used in deselected tests
+                         python-matplotx
+                         python-meshio
+                         python-meshzoo
+                         python-pytest
+                         python-scipy))
+    (arguments
+     (list
+      #:test-flags
+      ;; These tests fails with unexpected keyword arguments
+      ;; in calls to cplot.
+      #~(list "--deselect" "tests/test_u3.py::test_write_single"
+              "--deselect" "tests/test_u3.py::test_write_tree")))
+    (home-page "https://github.com/diego-hayashi/orthopy")
+    (synopsis "Tools for orthogonal polynomials, Gaussian quadrature")
+    (description "@code{orthopy} provides various orthogonal polynomial
+classes for lines, triangles, quadrilaterals, disks, spheres, hexahedra,
+and n-cubes.  All computations are done using numerically stable
+recurrence schemes.  Furthermore, all functions are fully vectorized and
+can return results in exact arithmetic.")
+    (license license:gpl3+)))
+
 (define-public slepc
   (package
     (name "slepc")
-- 
cgit 1.4.1


From 7308129335ea7c8c4e3ce9d6e0adca0b5811087c Mon Sep 17 00:00:00 2001
From: Felix Gruber <felgru@posteo.net>
Date: Sat, 4 Nov 2023 15:02:39 +0000
Subject: gnu: Add python-quadpy.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* gnu/packages/maths.scm (python-quadpy): New variable.

Change-Id: Icb5a60920465bc5861cf32ffe5dc44a9088af890
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
 gnu/packages/maths.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

(limited to 'gnu/packages/maths.scm')

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 9363c536c2..72f9f2587a 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -137,6 +137,7 @@
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages icu4c)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages image-processing)
   #:use-module (gnu packages java)
   #:use-module (gnu packages less)
   #:use-module (gnu packages lisp)
@@ -165,6 +166,7 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-build)
+  #:use-module (gnu packages python-science)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
@@ -3758,6 +3760,40 @@ recurrence schemes.  Furthermore, all functions are fully vectorized and
 can return results in exact arithmetic.")
     (license license:gpl3+)))
 
+(define-public python-quadpy
+  (package
+    (name "python-quadpy")
+    (version "0.16.10")
+    (source
+      (origin
+        (method url-fetch)
+        ; Download zipfile from zenodo, because git checkout is missing
+        ; some data files that are stored via git-lfs.
+        (uri (string-append
+               "https://zenodo.org/records/5541216/files/nschloe/quadpy-v"
+               version
+               ".zip"))
+        (sha256
+          (base32
+            "1f989dipv7lqxvalfrvvlmhlxyl67a87lavyyqrr1mh88glhl592"))))
+    (build-system pyproject-build-system)
+    (propagated-inputs
+      (list python-importlib-metadata
+            python-numpy
+            python-orthopy
+            python-scipy
+            python-sympy))
+    (native-inputs (list python-accupy python-pytest unzip vtk))
+    (home-page "https://github.com/diego-hayashi/quadpy")
+    (synopsis "Numerical integration, quadrature for various domains")
+    (description
+      "More than 1500 numerical integration schemes for line segments, circles,
+disks, triangles, quadrilaterals, spheres, balls, tetrahedra, hexahedra,
+wedges, pyramids, n-spheres, n-balls, n-cubes, n-simplices, and the
+1D/2D/3D/nD spaces with weight functions exp(-r) and exp(-r2) for fast
+integration of real-, complex-, and vector-valued functions.")
+    (license license:gpl3+)))
+
 (define-public slepc
   (package
     (name "slepc")
-- 
cgit 1.4.1


From 310f7966e78569653ad47b2e550e65e74719ca73 Mon Sep 17 00:00:00 2001
From: Andy Tai <atai@atai.org>
Date: Fri, 1 Dec 2023 22:55:19 -0800
Subject: gnu: wxmaxima: Update to 23.11.0

* gnu/packages/maths.scm (wxmaxima): Update to 23.11.0

Change-Id: Ifd1d705ec21f8f437eeb6364dea7d51638567eb7
Signed-off-by: Guillaume Le Vaillant <glv@posteo.net>
---
 gnu/packages/maths.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'gnu/packages/maths.scm')

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 72f9f2587a..0f4d29b40f 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4890,7 +4890,7 @@ point numbers.")
 (define-public wxmaxima
   (package
     (name "wxmaxima")
-    (version "22.12.0")
+    (version "23.11.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -4899,7 +4899,7 @@ point numbers.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "12bjadmy2mf7d8v4iszmzckahfcwjzaba8wpbigksh4brvhb4gj5"))))
+                "0xj91wfkm19avwmpcfwgzdkcqjwfpkl3glhkpn4advsqc6sx3ra0"))))
     (build-system cmake-build-system)
     (native-inputs (list gettext-minimal))
     (inputs (list bash-minimal
-- 
cgit 1.4.1