Skip to content

Commit

Permalink
gui/displays: do not test for empty list using bool conversion (break…
Browse files Browse the repository at this point in the history
…s for numpy arrays). Closes #153
sbourdeauducq committed Oct 22, 2015
1 parent 50809e0 commit e4165ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions artiq/gui/displays.py
Original file line number Diff line number Diff line change
@@ -137,7 +137,7 @@ def update_data(self, data):
error = data.get(result_error, None)
fit = data.get(result_fit, None)

if not y or len(y) != len(x):
if not len(y) or len(y) != len(x):
return
if error is not None and hasattr(error, "__len__"):
if not len(error):
@@ -201,7 +201,7 @@ def update_data(self, data):
if x is None:
x = list(range(len(y)+1))

if y and len(x) == len(y) + 1:
if len(y) and len(x) == len(y) + 1:
self.plot.clear()
self.plot.plot(x, y, stepMode=True, fillLevel=0,
brush=(0, 0, 255, 150))

0 comments on commit e4165ae

Please sign in to comment.