From cd336b5c7ea3e9944665fd8e32a3bf2ff9a8a99f Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Tue, 19 May 2020 09:36:58 +0200 Subject: [PATCH] [MRG] split_naming='bids' changes from _part-%d to _split-%d (#7794) * _part- -> _split- for split_naming='bids' * add whatsnew * DOC: minor link fix * Update doc/changes/latest.inc Co-authored-by: Alexandre Gramfort --- doc/changes/0.20.inc | 11 +++++++++++ mne/__init__.py | 2 +- mne/io/fiff/tests/test_raw_fiff.py | 4 ++-- mne/io/utils.py | 2 +- tutorials/io/plot_20_reading_eeg_data.py | 4 ++-- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/doc/changes/0.20.inc b/doc/changes/0.20.inc index e6fb8c4caef..15433b2e826 100644 --- a/doc/changes/0.20.inc +++ b/doc/changes/0.20.inc @@ -7,6 +7,17 @@ - "Bug" for bug fixes - "API" for backward-incompatible changes +.. _changes_0_20_4: + +Version 0.20.4 +-------------- + +Bug +~~~ + +- BIDS conformity: When saving FIF files to disk and the files are split into parts, the ``split_naming='bids'`` parameter now uses a "_split-%d" naming instead of the previous "_part-%d", by `Stefan Appelhoff`_ + + .. _changes_0_20_4: Version 0.20.4 diff --git a/mne/__init__.py b/mne/__init__.py index 792d1e17ffa..74584f27abf 100644 --- a/mne/__init__.py +++ b/mne/__init__.py @@ -16,7 +16,7 @@ # Dev branch marker is: 'X.Y.devN' where N is an integer. # -__version__ = '0.20.4' +__version__ = '0.20.5' # have to import verbose first since it's needed by many things from .utils import (set_log_level, set_log_file, verbose, set_config, diff --git a/mne/io/fiff/tests/test_raw_fiff.py b/mne/io/fiff/tests/test_raw_fiff.py index db1aff945bb..d68b2b94ccb 100644 --- a/mne/io/fiff/tests/test_raw_fiff.py +++ b/mne/io/fiff/tests/test_raw_fiff.py @@ -366,8 +366,8 @@ def test_split_files(tmpdir): split_fname = tmpdir.join('split_raw_meg.fif') # intended filenames split_fname_elekta_part2 = tmpdir.join('split_raw_meg-1.fif') - split_fname_bids_part1 = tmpdir.join('split_raw_part-01_meg.fif') - split_fname_bids_part2 = tmpdir.join('split_raw_part-02_meg.fif') + split_fname_bids_part1 = tmpdir.join('split_raw_split-01_meg.fif') + split_fname_bids_part2 = tmpdir.join('split_raw_split-02_meg.fif') raw_1.set_annotations(Annotations([2.], [5.5], 'test')) raw_1.save(split_fname, buffer_size_sec=1.0, split_size='10MB') diff --git a/mne/io/utils.py b/mne/io/utils.py index bf0d64ee4fd..2878dd6bbfd 100644 --- a/mne/io/utils.py +++ b/mne/io/utils.py @@ -305,6 +305,6 @@ def _construct_bids_filename(base, ext, part_idx): idx = deconstructed_base.index(mod) modality = deconstructed_base.pop(idx) base = '_'.join(deconstructed_base) - use_fname = '%s_part-%02d_%s%s' % (base, part_idx, modality, ext) + use_fname = '{}_split-{:02}_{}{}'.format(base, part_idx, modality, ext) return use_fname diff --git a/tutorials/io/plot_20_reading_eeg_data.py b/tutorials/io/plot_20_reading_eeg_data.py index f51e2372848..dbbb15386d5 100644 --- a/tutorials/io/plot_20_reading_eeg_data.py +++ b/tutorials/io/plot_20_reading_eeg_data.py @@ -35,8 +35,8 @@ * key-value pairs marked as ``key=value`` A documentation for core BrainVision file format is provided by Brain Products. -You can view the specification -`here `_ +You can view the specification hosted on the +`Brain Products website `_ BrainVision EEG files can be read in using :func:`mne.io.read_raw_brainvision` with the .vhdr header file as an input.