Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/nectarchain/dqm/bokeh_app/app_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"PED-INTEGRATION-.*",
"START-TIMES",
"WF-.*",
".*PixTimeline-.*",
".*PIXTIMELINE-.*",
]
TEST_PATTERN = "(?:% s)" % "|".join(NOTINDISPLAY)

Expand All @@ -30,8 +30,8 @@ def get_rundata(src, runid):
def make_camera_displays(db, source, runid):
displays = collections.defaultdict(dict)
for parentkey in db[runid].keys():
for childkey in db[runid][parentkey].keys():
if not re.match(TEST_PATTERN, childkey):
if not re.match(TEST_PATTERN, parentkey):
for childkey in db[runid][parentkey].keys():
print(f"Run id {runid} Preparing plot for {parentkey}, {childkey}")
displays[parentkey][childkey] = make_camera_display(
source, parent_key=parentkey, child_key=childkey
Expand Down
28 changes: 13 additions & 15 deletions src/nectarchain/dqm/bokeh_app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
displays[k][kk].image = np.zeros(shape=constants.N_PIXELS)

for parentkey in db[runid].keys():
for childkey in db[runid][parentkey].keys():
if not re.match(TEST_PATTERN, childkey):
if not re.match(TEST_PATTERN, parentkey):
for childkey in db[runid][parentkey].keys():

Check warning on line 33 in src/nectarchain/dqm/bokeh_app/main.py

View check run for this annotation

Codecov / codecov/patch

src/nectarchain/dqm/bokeh_app/main.py#L32-L33

Added lines #L32 - L33 were not covered by tests
print(f"Run id {runid} Updating plot for {parentkey}, {childkey}")

image = new_rundata[parentkey][childkey]
Expand All @@ -56,26 +56,24 @@
# displays[parentkey][childkey].datasource.stream(image)


print("Opening connection to ZODB")

Check warning on line 59 in src/nectarchain/dqm/bokeh_app/main.py

View check run for this annotation

Codecov / codecov/patch

src/nectarchain/dqm/bokeh_app/main.py#L59

Added line #L59 was not covered by tests
db = DQMDB(read_only=True).root
print("Getting list of run numbers")

Check warning on line 61 in src/nectarchain/dqm/bokeh_app/main.py

View check run for this annotation

Codecov / codecov/patch

src/nectarchain/dqm/bokeh_app/main.py#L61

Added line #L61 was not covered by tests
runids = sorted(list(db.keys()))

# First, get the run id with the most populated result dictionary
runid_max = runids[-1]
largest = 0
for runid in runids:
larger = 0
for k in db[runid].keys():
length = len(db[runid][k])
if length > larger:
larger = length
if larger > largest:
largest = larger
runid_max = runid
runid = runid_max

# On the full DB, this takes an awful lot of time, and saturates the RAM on the host
# VM (gets OoM killed)
# run_dict_lengths = [len(db[r]) for r in runids]
# runid = runids[np.argmax(run_dict_lengths)]
runid = "NectarCAM_Run0008"
print(f"We will start with run {runid}")

Check warning on line 70 in src/nectarchain/dqm/bokeh_app/main.py

View check run for this annotation

Codecov / codecov/patch

src/nectarchain/dqm/bokeh_app/main.py#L69-L70

Added lines #L69 - L70 were not covered by tests

print("Defining Select")

Check warning on line 72 in src/nectarchain/dqm/bokeh_app/main.py

View check run for this annotation

Codecov / codecov/patch

src/nectarchain/dqm/bokeh_app/main.py#L72

Added line #L72 was not covered by tests
# runid_input = NumericInput(value=db.root.keys()[-1], title="NectarCAM run number")
run_select = Select(value=runid, title="NectarCAM run number", options=runids)

print(f"Getting data for run {run_select.value}")

Check warning on line 76 in src/nectarchain/dqm/bokeh_app/main.py

View check run for this annotation

Codecov / codecov/patch

src/nectarchain/dqm/bokeh_app/main.py#L76

Added line #L76 was not covered by tests
source = get_rundata(db, run_select.value)
displays = make_camera_displays(db, source, runid)

Expand Down
3 changes: 2 additions & 1 deletion src/nectarchain/dqm/db_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import transaction
from BTrees.OOBTree import OOBTree

Check warning on line 2 in src/nectarchain/dqm/db_utils.py

View check run for this annotation

Codecov / codecov/patch

src/nectarchain/dqm/db_utils.py#L2

Added line #L2 was not covered by tests
from ZEO import ClientStorage
from ZODB import DB

Expand All @@ -17,7 +18,7 @@
def insert(self, key=None, value=None):
if key is not None and value is not None:
try:
self.root[key] = value
self.root[key] = OOBTree(value)

Check warning on line 21 in src/nectarchain/dqm/db_utils.py

View check run for this annotation

Codecov / codecov/patch

src/nectarchain/dqm/db_utils.py#L21

Added line #L21 was not covered by tests
return True
except AttributeError:
return False
Expand Down