bids-apps / PyMVPA

runs MVPA and RSA analysis BIDS bold derivative data
7 stars 3 forks source link

IndexError: list index out of range (current_event['onset'] = current_event['onset'] + offsets[chunks[i] - 1]) #11

Closed costantinoai closed 2 years ago

costantinoai commented 3 years ago

When running participant_test built from docker, the following error occurs:

Traceback (most recent call last): File "/code/run.py", line 197, in sub-09 current_event['onset'] = current_event['onset'] + offsets[chunks[i] - 1] IndexError: list index out of range

costantinoai commented 3 years ago

In case someone incurs in the same problem, it looks like this is happening because, in line 149

for filename in sorted(os.listdir(os.path.join(args.bids_dir, subj_name, 'func'))):

it loads also tsv files of other experiments if they exist in the same folder. A more correct implementation would be:

for filename in sorted(glob.glob(os.path.join(args.bids_dir, subj_name, 'func',('*' + args.task +'*.tsv')))):