@@ -86,7 +86,7 @@ def _thresholding(qc_value, thresholds=None):
8686 :param qc_value: proportion of passing qcs, between 0 and 1
8787 :param thresholds: dictionary with keys 'PASS', 'WARNING', 'FAIL'
8888 (cf. TaskQC.criteria attribute)
89- :return: int where -1: NOT_SET, 0: FAIL , 1: WARNING, 2: PASS
89+ :return: int where -1: NOT_SET, 0: PASS , 1: WARNING, 2: FAIL
9090 """
9191 MAX_BOUND , MIN_BOUND = (1 , 0 )
9292 if not thresholds :
@@ -95,15 +95,16 @@ def _thresholding(qc_value, thresholds=None):
9595 return int (- 1 )
9696 elif (qc_value > MAX_BOUND ) or (qc_value < MIN_BOUND ):
9797 raise ValueError ("Values out of bound" )
98- else :
99- if 'PASS' in thresholds and qc_value >= thresholds ['PASS' ]:
100- return 0
101- elif 'WARNING' in thresholds and qc_value >= thresholds ['WARNING' ]:
102- return 1
103- elif 'FAIL' in thresholds and qc_value >= thresholds ['FAIL' ]:
104- return 2
105- else :
106- return - 1
98+ if 'PASS' in thresholds .keys () and qc_value >= thresholds ['PASS' ]:
99+ return 0
100+ if 'WARNING' in thresholds .keys () and qc_value >= thresholds ['WARNING' ]:
101+ return 1
102+ if 'FAIL' in thresholds and qc_value >= thresholds ['FAIL' ]:
103+ return 2
104+ if 'NOT_SET' in thresholds and qc_value >= thresholds ['NOT_SET' ]:
105+ return - 1
106+ # if None of this applies, return 'NOT_SET'
107+ return - 1
107108
108109 def __init__ (self , session_path_or_eid , ** kwargs ):
109110 """
0 commit comments