Skip to content

Commit 50388b4

Browse files
committed
Merge remote-tracking branch 'upstream/main' into add_emg_support
2 parents 571f7c2 + 60830be commit 50388b4

23 files changed

+1536
-146
lines changed

.github/workflows/unit_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ jobs:
212212
uses: actions/cache@v4
213213
with:
214214
path: ${{ env.pythonLocation }}
215-
key: test-2-${{ env.pythonLocation }}-${{ env.os }}-${{ hashFiles('pyproject.toml') }}
215+
key: test-2-${{ env.pythonLocation }}-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.mne-version }}-${{ hashFiles('pyproject.toml') }}
216216

217217
- name: Install Python dependencies using pip
218218
# This would be nicer once this feature is implemented: https://github.com/pypa/pip/issues/11440
@@ -311,7 +311,7 @@ jobs:
311311

312312
- uses: actions/cache@v4
313313
with:
314-
key: testing_data-1-${{ env.TESTING_VERSION }}
314+
key: testing_data-1-${{ env.TESTING_VERSION }}-${{ matrix.mne-version }}
315315
path: ~/mne_data
316316
name: 'Cache testing data'
317317

.pre-commit-config.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.14.2
3+
rev: v0.14.3
44
hooks:
55
- id: ruff
66
name: ruff mne_bids/
@@ -37,3 +37,10 @@ repos:
3737
hooks:
3838
- id: toml-sort-fix
3939
files: pyproject.toml
40+
41+
- repo: https://github.com/pre-commit/pre-commit-hooks
42+
rev: v6.0.0
43+
hooks:
44+
- id: file-contents-sorter
45+
files: ^doc/authors.rst|^.mailmap
46+
args: ["--ignore-case"]

CITATION.cff

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ authors:
225225
family-names: Aristimunha
226226
affiliation: 'Université Paris-Saclay, LISN, Inria TAU/INRIA Nerv, France'
227227
orcid: 'https://orcid.org/0000-0001-5258-2995'
228+
- given-names: Kalle
229+
family-names: Mäkelä
230+
affiliation: 'University of Helsinki, Helsinki, Finland'
231+
orcid: 'https://orcid.org/0009-0005-5706-0842'
228232
- given-names: Alexandre
229233
family-names: Gramfort
230234
affiliation: 'Université Paris-Saclay, Inria, CEA, Palaiseau, France'

doc/Makefile

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,22 @@ help:
1818
# Catch-all target: route all unknown targets to Sphinx using the new
1919
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
2020
%: Makefile
21-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(O)
22+
23+
# Build without executing the example gallery (faster)
24+
html-noplot:
25+
@$(SPHINXBUILD) $(SPHINXOPTS) -D plot_gallery=0 $(SOURCEDIR) $(BUILDDIR)
2226

2327
# View the built documentation
28+
# If we build the example gallery, the index file is at _build/html/index.html
29+
# If we don't (e.g. html-noplot), then it is at _build/index.html
2430
view:
25-
@python -c "import webbrowser; webbrowser.open_new_tab('file://$(PWD)/_build/html/index.html')"
31+
@if [ -f "$(BUILDDIR)/html/index.html" ]; then \
32+
python -c "import webbrowser; webbrowser.open_new_tab('file://$(PWD)/$(BUILDDIR)/html/index.html')"; \
33+
elif [ -f "$(BUILDDIR)/index.html" ]; then \
34+
python -c "import webbrowser; webbrowser.open_new_tab('file://$(PWD)/$(BUILDDIR)/index.html')"; \
35+
else echo "No index.html file found to open. Did you build the docs?"; \
36+
fi
2637

2738
clean:
2839
-rm -rf _build auto_examples generated

doc/authors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
.. _Julia Guiomar Niso Galán: https://github.com/guiomar
3333
.. _Julius Welzel: https://github.com/JuliusWelzel
3434
.. _Kaare Mikkelsen: https://github.com/kaare-mikkelsen
35+
.. _Kalle Mäkelä: https://github.com/Kallemakela
3536
.. _Kambiz Tavabi: https://github.com/ktavabi
3637
.. _Laetitia Fesselier: https://github.com/laemtl
3738
.. _Mainak Jas: https://jasmainak.github.io/
@@ -60,4 +61,3 @@
6061
.. _waldie11: https://github.com/waldie11
6162
.. _William Turner: https://bootstrapbill.github.io/
6263
.. _Yorguin Mantilla: https://github.com/yjmantilla
63-
.. _Julius Welzel: https://github.com/JuliusWelzel

doc/install.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Optional:
2626
* ``pandas`` (>=1.3.2, for generating event statistics)
2727
* ``edfio`` (>=0.4.10, for writing EDF data)
2828
* ``defusedxml`` (for writing reading EGI MFF data and BrainVision montages)
29+
* ``filelock`` (for atomic file writing, and parallel processing support)
2930

3031
We recommend installing ``mne-bids`` into an isolated Python environment,
3132
for example created via ``conda``

doc/whats_new.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The following authors contributed for the first time. Thank you so much! 🤩
2222
* `Julius Welzel`_
2323
* `Alex Lopez Marquez`_
2424
* `Bruno Aristimunha`_
25+
* `Kalle Mäkelä`_
2526

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

@@ -37,15 +38,18 @@ Detailed list of changes
3738
- :func:`mne_bids.write_raw_bids()` has a new parameter `electrodes_tsv_task` which allows adding the `task` entity to the `electrodes.tsv` filepath, by `Alex Lopez Marquez`_ (:gh:`1424`)
3839
- Extended the configuration to recognise `motion` as a valid BIDS datatype by `Julius Welzel`_ (:gh:`1430`)
3940
- Better control of verbosity in several functions, by `Bruno Aristimunha`_ (:gh:`1449`)
41+
- Added parallel reading and writing in all the `open` operations using `_open_lock` mechanism from mne, creating a small wrapper to manage the locks by `Bruno Aristimunha`_ (:gh:`1451`)
4042
- :meth:`mne_bids.BIDSPath.match()` now short-circuits root directory scans when ``subject``, ``session``, or ``datatype`` entities are known, reducing lookup time on large datasets, by `Bruno Aristimunha`_ and `Maximilien Chaumon`_ (:gh:`1450`)
4143

4244
🧐 API and behavior changes
4345
^^^^^^^^^^^^^^^^^^^^^^^^^^^
4446

4547
- `tracksys` accepted as argument in :class:`mne_bids.BIDSPath()` by `Julius Welzel`_ (:gh:`1430`)
48+
- :func:`mne_bids.read_raw_bids()` has a new parameter ``on_ch_mismatch`` that controls behaviour when there is a mismatch between channel names in ``channels.tsv`` and the raw data; accepted values are ``'raise'`` (default), ``'reorder'``, and ``'rename'``, by `Kalle Mäkelä`_.
4649

4750
🛠 Requirements
4851
^^^^^^^^^^^^^^^
52+
- Including ``filelock`` as a dependency to handle atomic file writing and parallel processing support by `Bruno Aristimunha`_ (:gh:`1451`)
4953

5054
- None yet
5155

@@ -54,6 +58,8 @@ Detailed list of changes
5458

5559
- Fixed a bug that modified the name and help message of some of the available commands, by `Alex Lopez Marquez`_ (:gh:`1441`)
5660
- Updated MEG/iEEG writers to satisfy the stricter checks in the latest BIDS validator releases: BTi/4D run folders now retain their ``.pdf`` suffix (falling back to the legacy naming when an older validator is detected), KIT marker files encode the run via the ``acq`` entity instead of ``run``, datasets lacking iEEG montages receive placeholder ``electrodes.tsv``/``coordsystem.json`` files, and the ``AssociatedEmptyRoom`` entry stores dataset-relative paths by `Bruno Aristimunha`_ (:gh:`1449`)
61+
- Made the lock helpers skip reference counting when the optional ``filelock`` dependency is missing, preventing spurious ``AttributeError`` crashes during reads, by `Bruno Aristimunha`_ (:gh:`1469`)
62+
- Fixed a bug in :func:`mne_bids.read_raw_bids` that caused it to fail when reading BIDS datasets where the acquisition time was specified in local time rather than UTC only in Windows, by `Bruno Aristimunha`_ (:gh:`1452`)
5763

5864
⚕️ Code health
5965
^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)