Skip to content

Commit

Permalink
[MRG] split_naming='bids' changes from _part-%d to _split-%d (#7794)
Browse files Browse the repository at this point in the history
* _part- -> _split- for split_naming='bids'

* add whatsnew

* DOC: minor link fix

* Update doc/changes/latest.inc

Co-authored-by: Alexandre Gramfort <alexandre.gramfort@m4x.org>
  • Loading branch information
2 people authored and larsoner committed May 19, 2020
1 parent 903f443 commit cd336b5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions doc/changes/0.20.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mne/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions mne/io/fiff/tests/test_raw_fiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion mne/io/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions tutorials/io/plot_20_reading_eeg_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://docs.google.com/viewer?url=https://raw.githubusercontent.com/sappelhoff/brainvision-validator/master/doc/BrainVisionCoreFileFormat.pdf>`_
You can view the specification hosted on the
`Brain Products website <https://www.brainproducts.com/productdetails.php?id=21&tab=5>`_
BrainVision EEG files can be read in using :func:`mne.io.read_raw_brainvision`
with the .vhdr header file as an input.
Expand Down

0 comments on commit cd336b5

Please sign in to comment.