Fix Numpy FutureWarning.

Don't accidentally compare an array to string. Fixes issue #243.
This commit is contained in:
u55 2016-01-11 23:02:12 -07:00
parent 9e8c2082ed
commit 2c415a8b03

View File

@ -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