FileNotFoundError with write_raw_bids()

  • MNE version: 1.8.0
  • Operating system: Rocky Linux 8.10 (Green Obsidian)

When I want to save the empty room file for my subjects with the following code, it works for most but not for all of them.

if not er_dir.exists():
            print('write empty room')
            write_raw_bids(raw_er, 
                            er_bids_path, 
                            overwrite=True, 
                            allow_preload = True, 
                            #anonymize={'daysback': daysback},
                            format = 'FIF')
  else:
      print('Empty Room file already there')

after …


Writing 'bids_root/sub-emptyroom/ses-20220607/meg/sub-emptyroom_ses-20220607_task-noise_meg.json'...
Writing 'bids_root/sub-emptyroom/ses-20220607/meg/sub-emptyroom_ses-20220607_task-noise_channels.tsv'...

What I get is this:

FileNotFoundError: [Errno 2] No such file or directory: 'bids_root/sub-emptyroom/ses-20220607/meg/sub-emptyroom_ses-20220607_task-noise_meg.fif'

But I don’t understand why, as the directory is the same and if I check it, it does exist.
In another subject/study it seems to be related also to the splitting of the file (which I think isn’t even necessary in this case) :

FileNotFoundError: [Errno 2] No such file or directory: 'bids_root/sub-emptyroom/ses-20190619/meg/sub-emptyroom_ses-20190619_task-noise_split-01_meg.fif'

If I specify it when I save the data with write_raw_bids(data, …, … ) as empty_room = raw_er (which would be more convenient), I run into similar problems.

Does anyone have an idea what is happening there?
Thanks!!!

I just found out that it happened because I ran multiple participants with the same empty room file in parallel.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.