Commit d3c4d57c authored by Vincent Michel's avatar Vincent Michel

Fix PEP8 and python2 compat

parent 862b6e16
Pipeline #969 passed with stages
in 1 minute and 19 seconds
......@@ -34,7 +34,8 @@ MAX_STRING_LENGTH = 80
# Helpers
Stats = namedtuple('Stats', 'realtime livetime triggers events icr ocr deadtime')
Stats = namedtuple(
'Stats', 'realtime livetime triggers events icr ocr deadtime')
def to_bytes(arg):
......@@ -154,7 +155,7 @@ def is_channel_running(channel):
def is_running():
"""Return True if any channel is running, False otherwise."""
return any(map(is_channel_running, get_channels()))
return any(is_channel_running(channel) for channel in get_channels())
# Statistics
......@@ -172,15 +173,15 @@ def get_module_statistics(module):
result = {}
for index, channel in enumerate(channels):
if channel != -1:
realtime = array[index * 7 + 0]
livetime = array[index * 7 + 1]
triggers = int(array[index * 7 + 3])
events = int(array[index * 7 + 4])
icr = int(array[index * 7 + 5])
ocr = int(array[index * 7 + 6])
deadtime = 1 - float(ocr) / icr if icr != 0 else 1.
result[channel] = Stats(
realtime, livetime, triggers, events, icr, ocr, deadtime)
realtime = array[index * 7 + 0]
livetime = array[index * 7 + 1]
triggers = int(array[index * 7 + 3])
events = int(array[index * 7 + 4])
icr = int(array[index * 7 + 5])
ocr = int(array[index * 7 + 6])
deadtime = 1 - float(ocr) / icr if icr != 0 else 1.
result[channel] = Stats(
realtime, livetime, triggers, events, icr, ocr, deadtime)
return result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment