mne-tools / mne-bids

MNE-BIDS is a Python package that allows you to read and write BIDS-compatible datasets with the help of MNE-Python.
https://mne.tools/mne-bids/
BSD 3-Clause "New" or "Revised" License
133 stars 88 forks source link

write_raw_bids deletes SNIRF file #1021

Closed hoechenberger closed 2 years ago

hoechenberger commented 2 years ago

Reported at https://mne.discourse.group/t/write-raw-bids-deletes-snirf-file/5182

sappelhoff commented 2 years ago

I think this is related to:

... in the example the user explains how they first read from src, and then write back to src. SNIRF currently just uses copyfile ...

This happens first (note the unlink): https://github.com/mne-tools/mne-bids/blob/213c3789390dfacc285418d8f54c6575ca104e7f/mne_bids/write.py#L1826-L1837

And then finally this is supposed to happen: https://github.com/mne-tools/mne-bids/blob/213c3789390dfacc285418d8f54c6575ca104e7f/mne_bids/write.py#L1931-L1932

... but the file is not there anymore.

We'll have a proper error message after #889

Closing this as a duplicate of #867