From 37367c8ac5211cdfecf45177c28ede5f71aa2cea Mon Sep 17 00:00:00 2001 From: "D.-L.Pohl" Date: Fri, 23 Oct 2015 10:31:56 +0200 Subject: [PATCH 1/2] Update functions.py BUG: fix scaling with numpy 1.10 --- pyqtgraph/functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyqtgraph/functions.py b/pyqtgraph/functions.py index 0fd66419..19f05b76 100644 --- a/pyqtgraph/functions.py +++ b/pyqtgraph/functions.py @@ -826,7 +826,7 @@ def rescaleData(data, scale, offset, dtype=None): #p = np.poly1d([scale, -offset*scale]) #data = p(data).astype(dtype) d2 = data-offset - d2 *= scale + d2 = np.multiply(d2, scale) data = d2.astype(dtype) return data From e495bbc69b8ee676b4305f309bbe75f5291ae483 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Sat, 2 Jan 2016 10:31:03 -0800 Subject: [PATCH 2/2] Use inplace multiply --- pyqtgraph/functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyqtgraph/functions.py b/pyqtgraph/functions.py index 19f05b76..3936e926 100644 --- a/pyqtgraph/functions.py +++ b/pyqtgraph/functions.py @@ -826,7 +826,7 @@ def rescaleData(data, scale, offset, dtype=None): #p = np.poly1d([scale, -offset*scale]) #data = p(data).astype(dtype) d2 = data-offset - d2 = np.multiply(d2, scale) + np.multiply(d2, scale, out=d2, casting="unsafe") data = d2.astype(dtype) return data