unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 5b874e00561d0351dab50a42e9d4f863009c7381 1800 bytes (raw)
name: packages/patches/python-accupy-fix-use-of-perfplot.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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


debug log:

solving 5b874e00561d0351dab50a42e9d4f863009c7381 ...
found 5b874e00561d0351dab50a42e9d4f863009c7381 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).