Skip to content
New issue

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

FIX: account for potential .{integer}_meg4 extensions in CTF format #1230

Merged
merged 5 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions doc/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@
.. _Jonathan Vanhoecke: https://github.com/JonathanVHoecke
.. _Ford McDonald: https://github.com/fordmcdonald
.. _Pierre Guetschel: https://github.com/PierreGtch
.. _Mara Wolter: https://github.com/marakw
3 changes: 3 additions & 0 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Version 0.15 (unreleased)
The following authors contributed for the first time. Thank you so much! 🤩

* `Daniel McCloy`_
* `Mara Wolter`_

The following authors had contributed before. Thank you for sticking around! 🤘

Expand Down Expand Up @@ -59,6 +60,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`)
sappelhoff marked this conversation as resolved.
Show resolved Hide resolved

⚕️ Code health
^^^^^^^^^^^^^^
Expand Down
7 changes: 7 additions & 0 deletions mne_bids/copyfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ def copyfile_ctf(src, dest):
".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