From 2c415a8b03dc8bbb079c867d1f86d4b092bc4b79 Mon Sep 17 00:00:00 2001 From: u55 Date: Mon, 11 Jan 2016 23:02:12 -0700 Subject: [PATCH] Fix Numpy FutureWarning. Don't accidentally compare an array to string. Fixes issue #243. --- pyqtgraph/functions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyqtgraph/functions.py b/pyqtgraph/functions.py index 3936e926..09c2fea6 100644 --- a/pyqtgraph/functions.py +++ b/pyqtgraph/functions.py @@ -1312,15 +1312,15 @@ def arrayToQPath(x, y, connect='all'): connect[:,0] = 1 connect[:,1] = 0 connect = connect.flatten() - if connect == 'finite': + elif connect == 'finite': connect = np.isfinite(x) & np.isfinite(y) arr[1:-1]['c'] = connect - if connect == 'all': + elif connect == 'all': arr[1:-1]['c'] = 1 elif isinstance(connect, np.ndarray): arr[1:-1]['c'] = connect else: - raise Exception('connect argument must be "all", "pairs", or array') + raise Exception('connect argument must be "all", "pairs", "finite", or array') #profiler('fill array') # write last 0