move the assignment of the 'subject' and 'runs_found' keys outside the conditional
@@ -370,13 +370,11 @@ def expected_file_check(layout, config):
scan_params = deepcopy(scan_params_d)
seq_params = {i: scan_params[i] for i in scan_params if i != 'runs'}
actual_runs = layout.get(return_type='obj', subject=sub, extensions='.nii.gz', **seq_params)
- if len(actual_runs) != scan_params['runs']:
scan_params['subject'] = sub
scan_params['runs_found'] = len(actual_runs)
+ if len(actual_runs) != scan_params['runs']:
scan_params['problem'] = True
else:
- scan_params['subject'] = sub
- scan_params['runs_found'] = len(actual_runs)
scan_params['problem'] = False
summary_df = summary_df.append(scan_params, ignore_index=True)
print('sub {:}: done'.format(sub))
