Skip to content

Commit

Permalink
Account for potential .{int}_meg4 extensions by adding them separatel…
Browse files Browse the repository at this point in the history
…y to file types.
  • Loading branch information
marakw committed Feb 29, 2024
1 parent 4e7df02 commit 6820cf1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ authors:
family-names: Guetschel
orcid: 'https://orcid.org/0000-0002-8933-7640'
affiliation: 'Donders Institute for Brain, Cognition and Behaviour, Radboud University, Nijmegen, Netherlands'
- given-names: Mara
family-names: Wolter
orcid: 'https://orcid.org/0000-0002-6785-9886'
affiliation: 'Centre for Integrative Neuroscience, Tübingen, Germany'
- given-names: Alexandre
family-names: Gramfort
affiliation: 'Université Paris-Saclay, Inria, CEA, Palaiseau, France'
Expand Down
2 changes: 2 additions & 0 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ Detailed list of changes

- The datatype in the dataframe returned by :func:`mne_bids.stats.count_events` is now
``pandas.Int64Dtype`` instead of ``float64``, by `Eric Larson`_ (:gh:`1227`)
- The :func:`mne_bids.copyfiles.copyfile_ctf` now accounts for files with ``.{integer}_meg4`` extension, instead of only .meg4,
when renaming the files of a .ds folder, by `Mara Wolter`_ (:gh:`1230`)

⚕️ Code health
^^^^^^^^^^^^^^
Expand Down
7 changes: 6 additions & 1 deletion mne_bids/copyfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,15 @@ def copyfile_ctf(src, dest):
".hist",
".infods",
".bak",
"meg4",
".meg4",
".newds",
".res4",
)

# Consider CTF files that are split having consecutively numbered extensions
extra_ctf_file_types = tuple(f".{i}_meg4" for i in range(1, 21)) # cap at 20 is arbitrary
file_types += extra_ctf_file_types

# Rename files in dest with the name of the dest directory
fnames = [f for f in os.listdir(dest) if f.endswith(file_types)]
bids_folder_name = op.splitext(op.split(dest)[-1])[0]
Expand Down

0 comments on commit 6820cf1

Please sign in to comment.