diff --git a/code/data_processing/cc_qc.py b/code/data_processing/cc_qc.py index a9c7ecd657e..11ad1e3dd9d 100644 --- a/code/data_processing/cc_qc.py +++ b/code/data_processing/cc_qc.py @@ -86,7 +86,17 @@ def cc_qc(self, df, threshold, TS=False): CATEGORY = 2 print(f"FOR TASK SWITCHING -> Average accuracy at or below 0.5 across conditions and CATEGORY set to 2") - problematic_conditions = QC_UTILS.cond_block_not_reported(raw, self.ACC_COLUMN_NAME, self.COND_COLUMN_NAME, self.INCORRECT_SYMBOL) + # Check for blocks/conditions where every response is either incorrect + # or not reported. The first argument expects the column that defines + # the blocks/conditions and the second is the accuracy column. The + # previous implementation mistakenly flipped these arguments which + # caused the check to operate on the wrong columns. + problematic_conditions = QC_UTILS.cond_block_not_reported( + raw, + self.COND_COLUMN_NAME, + self.ACC_COLUMN_NAME, + self.INCORRECT_SYMBOL, + ) if len(problematic_conditions) != 0: CATEGORY = 3 diff --git a/code/data_processing/mem_qc.py b/code/data_processing/mem_qc.py index cb98f7a5628..aefb8fadc7b 100644 --- a/code/data_processing/mem_qc.py +++ b/code/data_processing/mem_qc.py @@ -68,7 +68,15 @@ def fn_sm_qc(self, df, threshold): print(f"Condition/Block '{condition}' has accuracy == 0% and CATEGORY set to 3") avg_acc /= len(accuracy) - problematic_conditions = QC_UTILS.cond_block_not_reported(raw, self.ACC_COLUMN_NAME, self.COND_COLUMN_NAME, self.INCORRECT_SYMBOL) + # Detect any blocks/conditions where all responses are incorrect or + # missing. The utility expects the condition column first followed by + # the accuracy column; previously these were reversed. + problematic_conditions = QC_UTILS.cond_block_not_reported( + raw, + self.COND_COLUMN_NAME, + self.ACC_COLUMN_NAME, + self.INCORRECT_SYMBOL, + ) if len(problematic_conditions) != 0: CATEGORY = 3 diff --git a/code/data_processing/ps_qc.py b/code/data_processing/ps_qc.py index 53f1f5d0dd2..1cbca4830ab 100644 --- a/code/data_processing/ps_qc.py +++ b/code/data_processing/ps_qc.py @@ -90,7 +90,14 @@ def ps_qc(self, submission, threshold, DSST=False): CATEGORY = 2 print(f"FOR DSST -> Average accuracy at or below 0.5 across conditions and CATEGORY set to 2") - problematic_conditions = QC_UTILS.cond_block_not_reported(raw, self.ACC_COLUMN_NAME, self.COND_COLUMN_NAME, self.INCORRECT_SYMBOL) + # Identify blocks/conditions with only incorrect or missing responses. + # Arguments were previously inverted, leading to incorrect detection. + problematic_conditions = QC_UTILS.cond_block_not_reported( + raw, + self.COND_COLUMN_NAME, + self.ACC_COLUMN_NAME, + self.INCORRECT_SYMBOL, + ) if len(problematic_conditions) != 0: CATEGORY = 3