Skip to content

Commit d361f7f

Browse files
committed
More clever way to find the run number with most information to initialize the DQM Bokeh app
1 parent 71e5900 commit d361f7f

File tree

1 file changed

+2
-12
lines changed
  • src/nectarchain/dqm/bokeh_app

1 file changed

+2
-12
lines changed

src/nectarchain/dqm/bokeh_app/main.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,8 @@ def update_camera_displays(attr, old, new):
6060
runids = sorted(list(db.keys()))
6161

6262
# First, get the run id with the most populated result dictionary
63-
runid_max = runids[-1]
64-
largest = 0
65-
for runid in runids:
66-
larger = 0
67-
for k in db[runid].keys():
68-
length = len(db[runid][k])
69-
if length > larger:
70-
larger = length
71-
if larger > largest:
72-
largest = larger
73-
runid_max = runid
74-
runid = runid_max
63+
run_dict_lengths = [len(db[r].keys()) for r in runids]
64+
runid = runids[np.argmax(run_dict_lengths)]
7565

7666
# runid_input = NumericInput(value=db.root.keys()[-1], title="NectarCAM run number")
7767
run_select = Select(value=runid, title="NectarCAM run number", options=runids)

0 commit comments

Comments
 (0)