Skip to content
Snippets Groups Projects
Commit 010b8c0a authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Fill up top 10 on fresh start

parent f56c230b
No related branches found
No related tags found
No related merge requests found
......@@ -88,14 +88,15 @@ class ZTPlot(kp.Module):
"""Update the lower limits for the Top-10 candidate selection"""
n_candidates = 10
for category in ["overlays", "n_hits", "n_triggered_hits"]:
try:
lower_limit = self.services["query"](
"SELECT {cat} FROM {tab} ORDER BY {cat} DESC LIMIT {limit}".
format(cat=category,
tab=self.event_selection_table,
limit=n_candidates))[-1][0]
except IndexError:
lower_limits = self.services["query"](
"SELECT {cat} FROM {tab} ORDER BY {cat} DESC LIMIT {limit}".
format(cat=category,
tab=self.event_selection_table,
limit=n_candidates))
if len(lower_limits) < 10:
lower_limit = 0
else:
lower_limit = lower_limits[-1][0]
self.lower_limits[category] = lower_limit
self.cprint("Current limits for the Top-10: {}".format(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment