aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/python-accupy-fix-use-of-perfplot.patch
diff options
context:
space:
mode:
authorFelix Gruber <felgru@posteo.net>2023-11-04 15:02:36 +0000
committerLudovic Courtès <ludo@gnu.org>2023-12-04 22:26:37 +0100
commitbe73e08ba2fd8e9280840f8fa962e9821ba5b71e (patch)
treee48b05704b7eef9e31a9055b199a7d923a1007e6 /gnu/packages/patches/python-accupy-fix-use-of-perfplot.patch
parent880310007288f9901514ae779809c7b4915dfcc9 (diff)
downloadguix-be73e08ba2fd8e9280840f8fa962e9821ba5b71e.tar.gz
guix-be73e08ba2fd8e9280840f8fa962e9821ba5b71e.zip
gnu: Add python-accupy.
* 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>
Diffstat (limited to 'gnu/packages/patches/python-accupy-fix-use-of-perfplot.patch')
-rw-r--r--gnu/packages/patches/python-accupy-fix-use-of-perfplot.patch48
1 files changed, 48 insertions, 0 deletions
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
+