We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MWE:
# %% from pathlib import Path import tempfile import mne import mne_bids sample_dir = Path(mne.datasets.sample.data_path()) sample_fname = sample_dir / 'MEG' / 'sample' / 'sample_audvis_raw.fif' raw = mne.io.read_raw_fif(sample_fname, preload=False) with tempfile.TemporaryDirectory() as tempdir: root = Path(tempdir) / 'some_path_with_tsv' bids_path = mne_bids.BIDSPath( subject='foo', task='bar', root=root, suffix='meg', datatype='meg', extension='.fif' ) mne_bids.write_raw_bids(raw=raw, bids_path=bids_path)
Yields:
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/xg/7d96k64d7jv9q1d88_s8swjh0000gn/T/tmp5xdixz1g/some_path_with_json/participants.json'
See how the directory name some_path_with_tsv was changed to some_path_with_json.
some_path_with_tsv
some_path_with_json
Issue originates from here:
mne-bids/mne_bids/write.py
Lines 1348 to 1349 in 11e3efc
Quick & dirty fix: instead of replacing tsv, we should only replace .tsv. But this still leaves room for problems.
tsv
.tsv
Cleaner solution would be to rely e.g. on pathlib to help us find the filename extension, and only operate on that.
pathlib
The text was updated successfully, but these errors were encountered:
can we close this now @hoechenberger ?
Sorry, something went wrong.
It's something we should address someday, but I don't think it's much use to keep this issue around, so yeah let's close it
hoechenberger
No branches or pull requests
MWE:
Yields:
See how the directory name
some_path_with_tsv
was changed tosome_path_with_json
.Issue originates from here:
mne-bids/mne_bids/write.py
Lines 1348 to 1349 in 11e3efc
Quick & dirty fix: instead of replacing
tsv
, we should only replace.tsv
. But this still leaves room for problems.Cleaner solution would be to rely e.g. on
pathlib
to help us find the filename extension, and only operate on that.The text was updated successfully, but these errors were encountered: