Skip to content

Commit 33fd477

Browse files
committed
ignore pupil_diameter_snr check in dlc qc aggregate
1 parent 8fa4203 commit 33fd477

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ibllib/qc/dlc.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ class DlcQC(base.QC):
4646
'body': ['_ibl_bodyCamera.dlc.*', '_ibl_bodyCamera.times.*'],
4747
}
4848

49-
def __init__(self, session_path_or_eid, side, **kwargs):
49+
def __init__(self, session_path_or_eid, side, ignore_checks=['check_pupil_diameter_snr'], **kwargs):
5050
"""
5151
:param session_path_or_eid: A session eid or path
5252
:param side: The camera to run QC on
53+
:param ignore_checks: Checks that won't count towards aggregate QC, but will be run and added to extended QC
5354
:param log: A logging.Logger instance, if None the 'ibllib' logger is used
5455
:param one: An ONE instance for fetching and setting the QC on Alyx
5556
"""
@@ -61,6 +62,8 @@ def __init__(self, session_path_or_eid, side, **kwargs):
6162
super().__init__(session_path_or_eid, **kwargs)
6263
self.data = Bunch()
6364

65+
# checks to be added to extended QC but not taken into account for aggregate QC
66+
self.ignore_checks = ignore_checks
6467
# QC outcomes map
6568
self.metrics = None
6669

@@ -139,7 +142,9 @@ def is_metric(x):
139142
checks = getmembers(DlcQC, is_metric)
140143
self.metrics = {f'_{namespace}_' + k[6:]: fn(self) for k, fn in checks}
141144

142-
values = [x if isinstance(x, str) else x[0] for x in self.metrics.values()]
145+
ignore_metrics = [f'_{namespace}_' + i[6:] for i in self.ignore_checks]
146+
metrics_to_aggregate = {k: v for k, v in self.metrics.items() if k not in ignore_metrics}
147+
values = [x if isinstance(x, str) else x[0] for x in metrics_to_aggregate.values()]
143148
code = max(base.CRITERIA[x] for x in values)
144149
outcome = next(k for k, v in base.CRITERIA.items() if v == code)
145150

0 commit comments

Comments
 (0)