Skip to content

Commit 178d1a9

Browse files
committed
removed fcns_value2status
1 parent 1fae5b8 commit 178d1a9

File tree

1 file changed

+3
-39
lines changed

1 file changed

+3
-39
lines changed

ibllib/qc/task_metrics.py

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -80,41 +80,6 @@ class TaskQC(base.QC):
8080
criteria['_task_iti_delays'] = {"NOT_SET": 0}
8181
criteria['_task_passed_trial_checks'] = {"NOT_SET": 0}
8282

83-
# fcns_value2status = {k: lambda x: TaskQC._thresholding(x, thresholds=v) for k, v in criteria.items()}
84-
85-
fcns_value2status = {'default': lambda x: TaskQC._thresholding(x),
86-
'_task_stimOff_itiIn_delays': lambda x:
87-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
88-
'_task_positive_feedback_stimOff_delays': lambda x:
89-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
90-
'_task_negative_feedback_stimOff_delays': lambda x:
91-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
92-
'_task_wheel_move_during_closed_loop': lambda x:
93-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
94-
'_task_response_stimFreeze_delays': lambda x:
95-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
96-
'_task_detected_wheel_moves': lambda x:
97-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
98-
'_task_trial_length': lambda x:
99-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
100-
'_task_goCue_delays': lambda x:
101-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
102-
'_task_errorCue_delays': lambda x:
103-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
104-
'_task_stimOn_delays': lambda x:
105-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
106-
'_task_stimOff_delays': lambda x:
107-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
108-
'_task_iti_delays': lambda x: -1, # TODO figure why nearly always = 0 ;
109-
# thresholds={"NOT_SET": 0}
110-
'_task_stimFreeze_delays': lambda x:
111-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
112-
'_task_wheel_integrity': lambda x:
113-
TaskQC._thresholding(x, thresholds={"PASS": 0.99, "WARNING": 0}),
114-
'_task_passed_trial_checks': lambda x: -1 # TODO figure why always = 0 ;
115-
# thresholds={"PASS": 0.90, "WARNING": 0}
116-
}
117-
11883
@staticmethod
11984
def _thresholding(qc_value, thresholds=None):
12085
"""
@@ -210,13 +175,12 @@ def compute_session_status_from_dict(results):
210175
:return: Overall session QC outcome as a string
211176
:return: A dict of QC tests and their outcomes
212177
"""
213-
v2status_fcns = TaskQC.fcns_value2status # the need to have this as a parameter may arise
214178
indices = np.zeros(len(results), dtype=int)
215179
for i, k in enumerate(results):
216-
if k in v2status_fcns:
217-
indices[i] = v2status_fcns[k](results[k])
180+
if k in TaskQC.criteria.keys():
181+
indices[i] = TaskQC._thresholding(results[k], thresholds=TaskQC.criteria[k])
218182
else:
219-
indices[i] = v2status_fcns['default'](results[k])
183+
indices[i] = TaskQC._thresholding(results[k], thresholds=TaskQC.criteria['default'])
220184

221185
def key_map(x):
222186
return 'NOT_SET' if x < 0 else list(TaskQC.criteria['default'].keys())[x]

0 commit comments

Comments
 (0)