Skip to content

Commit 6aa9511

Browse files
committed
Merge remote-tracking branch 'upstream/main' into rework_mne_bids_path_match
2 parents 2ccdfc9 + 46f284b commit 6aa9511

File tree

13 files changed

+242
-130
lines changed

13 files changed

+242
-130
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
fetch-tags: true
2225
- uses: actions/setup-python@v5
2326
with:
2427
python-version: '3.12'
@@ -32,6 +35,7 @@ jobs:
3235
with:
3336
name: dist
3437
path: dist
38+
include-hidden-files: true
3539

3640
pypi-upload:
3741
needs: package

.github/workflows/unit_tests.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
python-version: ["3.12"]
2323
steps:
2424
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
fetch-tags: true
2528
- name: Set up Python ${{ matrix.python-version }}
2629
uses: actions/setup-python@v5
2730
with:
@@ -65,6 +68,9 @@ jobs:
6568
python -m pip install build twine
6669
6770
- uses: actions/checkout@v4
71+
with:
72+
fetch-depth: 0
73+
fetch-tags: true
6874
- name: Build sdist
6975
run: python -m build --sdist
7076
- name: Check sdist
@@ -81,6 +87,9 @@ jobs:
8187
run: python -m pip uninstall -y mne-bids
8288

8389
- uses: actions/checkout@v4
90+
with:
91+
fetch-depth: 0
92+
fetch-tags: true
8493
- name: Build wheel
8594
run: python -m build --wheel
8695
- name: Check wheel
@@ -97,6 +106,9 @@ jobs:
97106
run: python -m pip uninstall -y mne-bids
98107

99108
- uses: actions/checkout@v4
109+
with:
110+
fetch-depth: 0
111+
fetch-tags: true
100112
- name: Test extras install
101113
run: |
102114
python -m pip install .[full]
@@ -161,6 +173,9 @@ jobs:
161173
FORCE_COLOR: true
162174
steps:
163175
- uses: actions/checkout@v4
176+
with:
177+
fetch-depth: 0
178+
fetch-tags: true
164179

165180
- name: Set up Node.js
166181
uses: actions/setup-node@v4
@@ -275,7 +290,7 @@ jobs:
275290
run: make test
276291

277292
- name: Upload coverage stats to codecov
278-
uses: codecov/codecov-action@v4
293+
uses: codecov/codecov-action@v5
279294
with:
280295
files: ./coverage.xml
281296
token: ${{ secrets.CODECOV_TOKEN }}
@@ -289,6 +304,9 @@ jobs:
289304
python-version: ["3.12"]
290305
steps:
291306
- uses: actions/checkout@v4
307+
with:
308+
fetch-depth: 0
309+
fetch-tags: true
292310
- name: Set up Python ${{ matrix.python-version }}
293311
uses: actions/setup-python@v5
294312
with:
@@ -310,3 +328,4 @@ jobs:
310328
with:
311329
name: documentation
312330
path: doc/_build/html
331+
include-hidden-files: true

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
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.7.3
3+
rev: v0.8.2
44
hooks:
55
- id: ruff
66
name: ruff mne_bids/
@@ -33,7 +33,7 @@ repos:
3333
- id: check-docstring-first
3434

3535
- repo: https://github.com/pappasam/toml-sort
36-
rev: v0.23.1
36+
rev: v0.24.2
3737
hooks:
3838
- id: toml-sort-fix
3939
files: pyproject.toml

CITATION.cff

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ authors:
198198
family-names: Turner
199199
affiliation: 'Wu Tsai Neurosciences Institute, Stanford University'
200200
orcid: 'https://orcid.org/0000-0001-8639-9769'
201+
- given-names: Christian
202+
family-names: O'Reilly
203+
affiliation: 'Computer Science and Engineering, University of South Carolina'
204+
orcid: 'https://orcid.org/0000-0002-3149-4934'
201205
- given-names: Alexandre
202206
family-names: Gramfort
203207
affiliation: 'Université Paris-Saclay, Inria, CEA, Palaiseau, France'

doc/authors.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@
5151
.. _Tom Donoghue: https://github.com/TomDonoghue
5252
.. _William Turner: https://bootstrapbill.github.io/
5353
.. _Yorguin Mantilla: https://github.com/yjmantilla
54+
.. _Christian O'Reilly: https://github.com/christian-oreilly

doc/whats_new.rst

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,74 +7,51 @@
77
What's new?
88
===========
99

10-
.. _changes_0_16:
10+
.. _changes_0_17:
1111

12-
Version 0.16 (2024-11-16)
12+
Version 0.17 (unreleased)
1313
-------------------------
1414

1515
👩🏽‍💻 Authors
1616
~~~~~~~~~~~~~~~
1717

1818
The following authors contributed for the first time. Thank you so much! 🤩
1919

20-
* `Aaron Earle-Richardson`_
21-
* `Amaia Benitez`_
22-
* `Kaare Mikkelsen`_
23-
* `Simon Kern`_
24-
* `Thomas Hartmann`_
25-
* `William Turner`_
20+
* `Christian O'Reilly`_
2621

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

29-
* `Daniel McCloy`_
30-
* `Eric Larson`_
31-
* `Mathieu Scheltienne`_
32-
* `Richard Höchenberger`_
33-
* `Scott Huberty`_
3424
* `Stefan Appelhoff`_
25+
* `Daniel McCloy`_
3526

3627
Detailed list of changes
3728
~~~~~~~~~~~~~~~~~~~~~~~~
3829

3930
🚀 Enhancements
4031
^^^^^^^^^^^^^^^
4132

42-
- :meth:`mne_bids.BIDSPath.match()` and :func:`mne_bids.find_matching_paths` now have additional parameters ``ignore_json`` and ``ignore_nosub``, to give users more control over which type of files are matched, by `Kaare Mikkelsen`_ (:gh:`1281`)
43-
- :func:`mne_bids.write_raw_bids()` can now handle event metadata as a pandas DataFrame, by `Thomas Hartmann`_ (:gh:`1285`)
33+
- :func:`mne_bids.write_raw_bids()` can now handle mne `Raw` objects with `eyegaze` and `pupil` channels, by `Christian O'Reilly`_ (:gh:`1344`)
34+
4435

4536
🧐 API and behavior changes
4637
^^^^^^^^^^^^^^^^^^^^^^^^^^^
4738

48-
- :func:`mne_bids.read_raw_bids` no longer warns about unit changes in channels upon reading, as that information is taken from ``channels.tsv`` and judged authorative, by `Stefan Appelhoff`_ (:gh:`1282`)
49-
- MEG OPM channels are now experimentally included, by `Amaia Benitez`_ (:gh:`1222`)
50-
- :func:`mne_bids.mark_channels` will no longer create a ``status_description`` column filled with ``n/a`` in the ``channels.tsv`` file, by `Stefan Appelhoff`_ (:gh:`1293`)
51-
- :func:`mark_channels(..., ch_names=[]) <mne_bids.mark_channels>` now raises a deprecation warning, and in future its behavior will change from marking *all* channels to marking *no* channels; to avoid the warning use ``mark_channels(..., ch_names="all")``, by `Daniel McCloy`_ (:gh:`1307`)
52-
39+
- Nothing yet
5340

5441
🛠 Requirements
5542
^^^^^^^^^^^^^^^
5643

57-
- MNE-BIDS now requires Python 3.10 or higher.
58-
- MNE-BIDS now requires ``mne`` 1.7 or higher.
44+
- Nothing yet
5945

6046
🪲 Bug fixes
6147
^^^^^^^^^^^^
6248

63-
- Writing MEGIN data with MNE channel types `chpi` will now map to BIDS type HLU by `Simon Kern`_ (:gh:`1325`)
64-
- When anonymizing the date of a recording, MNE-BIDS will no longer error during `~mne_bids.write_raw_bids` if passing a `~mne.io.Raw` instance to ``empty_room``, by `Daniel McCloy`_ (:gh:`1270`)
65-
- Dealing with alphanumeric ``sub`` entity labels is now fixed for :func:`~mne_bids.write_raw_bids`, by `Aaron Earle-Richardson`_ (:gh:`1291`)
66-
- When processing subject_info data that MNE Python imports as numpy arrays with only one item, MNE-BIDS now unpacks these, resulting in a correct participants.tsv, by `Thomas Hartmann`_ (:gh:`1310`)
67-
- Fixed broken links in examples 7 and 8, by `William Turner`_ (:gh:`1316`)
68-
- All valid extensions for ``README`` files are now accepted. This prevents an extra ``README`` file being created, when one with a ``.txt``, ``.md``, or ``.rst`` extension is already present. By `Thomas Hartmann`_ (:gh:`1318`)
69-
- A warning was given if no events were provided but the task was starting with 'rest' as recommended by `Simon Kern`_ (:gh:`1327`)
49+
- :func:`mne_bids.read_raw_bids` can optionally return an ``event_id`` dictionary suitable for use with :func:`mne.events_from_annotations`, and if a ``values`` column is present in ``events.tsv`` it will be used as the source of the integer event ID codes, by `Daniel McCloy`_ (:gh:`1349`)
7050

7151
⚕️ Code health
7252
^^^^^^^^^^^^^^
7353

74-
- Keep MNE-BIDS up to date with recent changes on participant birthday date handling in MNE-Python, by `Eric Larson`_ (:gh:`1278`)
75-
- Make rules for linting more strict, make quality assessment exceptions less permissive, by `Stefan Appelhoff`_ (:gh:`1283`)
76-
- Updates to use ``intersphinx_registry`` and sorting TOML files, by `Mathieu Scheltienne`_ (:gh:`1314`)
77-
- Fix dropdown menu in website, by `Scott Huberty`_ (:gh:`1298`)
54+
- Tests that were adding or deleting files to/from a session-scoped dataset now properly clean up after themselves, by `Daniel McCloy`_ (:gh:`1347`)
7855

7956
:doc:`Find out what was new in previous releases <whats_new_previous_releases>`
8057

doc/whats_new_previous_releases.rst

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,75 @@
77
What was new in previous releases?
88
==================================
99

10+
.. _changes_0_16:
11+
12+
Version 0.16 (2024-11-16)
13+
-------------------------
14+
15+
👩🏽‍💻 Authors
16+
~~~~~~~~~~~~~~~
17+
18+
The following authors contributed for the first time. Thank you so much! 🤩
19+
20+
* `Aaron Earle-Richardson`_
21+
* `Amaia Benitez`_
22+
* `Kaare Mikkelsen`_
23+
* `Simon Kern`_
24+
* `Thomas Hartmann`_
25+
* `William Turner`_
26+
27+
The following authors had contributed before. Thank you for sticking around! 🤘
28+
29+
* `Daniel McCloy`_
30+
* `Eric Larson`_
31+
* `Mathieu Scheltienne`_
32+
* `Richard Höchenberger`_
33+
* `Scott Huberty`_
34+
* `Stefan Appelhoff`_
35+
36+
Detailed list of changes
37+
~~~~~~~~~~~~~~~~~~~~~~~~
38+
39+
🚀 Enhancements
40+
^^^^^^^^^^^^^^^
41+
42+
- :meth:`mne_bids.BIDSPath.match()` and :func:`mne_bids.find_matching_paths` now have additional parameters ``ignore_json`` and ``ignore_nosub``, to give users more control over which type of files are matched, by `Kaare Mikkelsen`_ (:gh:`1281`)
43+
- :func:`mne_bids.write_raw_bids()` can now handle event metadata as a pandas DataFrame, by `Thomas Hartmann`_ (:gh:`1285`)
44+
45+
🧐 API and behavior changes
46+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
47+
48+
- :func:`mne_bids.read_raw_bids` no longer warns about unit changes in channels upon reading, as that information is taken from ``channels.tsv`` and judged authorative, by `Stefan Appelhoff`_ (:gh:`1282`)
49+
- MEG OPM channels are now experimentally included, by `Amaia Benitez`_ (:gh:`1222`)
50+
- :func:`mne_bids.mark_channels` will no longer create a ``status_description`` column filled with ``n/a`` in the ``channels.tsv`` file, by `Stefan Appelhoff`_ (:gh:`1293`)
51+
- :func:`mark_channels(..., ch_names=[]) <mne_bids.mark_channels>` now raises a deprecation warning, and in future its behavior will change from marking *all* channels to marking *no* channels; to avoid the warning use ``mark_channels(..., ch_names="all")``, by `Daniel McCloy`_ (:gh:`1307`)
52+
53+
54+
🛠 Requirements
55+
^^^^^^^^^^^^^^^
56+
57+
- MNE-BIDS now requires Python 3.10 or higher.
58+
- MNE-BIDS now requires ``mne`` 1.7 or higher.
59+
60+
🪲 Bug fixes
61+
^^^^^^^^^^^^
62+
63+
- Writing MEGIN data with MNE channel types `chpi` will now map to BIDS type HLU by `Simon Kern`_ (:gh:`1325`)
64+
- When anonymizing the date of a recording, MNE-BIDS will no longer error during `~mne_bids.write_raw_bids` if passing a `~mne.io.Raw` instance to ``empty_room``, by `Daniel McCloy`_ (:gh:`1270`)
65+
- Dealing with alphanumeric ``sub`` entity labels is now fixed for :func:`~mne_bids.write_raw_bids`, by `Aaron Earle-Richardson`_ (:gh:`1291`)
66+
- When processing subject_info data that MNE Python imports as numpy arrays with only one item, MNE-BIDS now unpacks these, resulting in a correct participants.tsv, by `Thomas Hartmann`_ (:gh:`1310`)
67+
- Fixed broken links in examples 7 and 8, by `William Turner`_ (:gh:`1316`)
68+
- All valid extensions for ``README`` files are now accepted. This prevents an extra ``README`` file being created, when one with a ``.txt``, ``.md``, or ``.rst`` extension is already present. By `Thomas Hartmann`_ (:gh:`1318`)
69+
- A warning was given if no events were provided but the task was starting with 'rest' as recommended by `Simon Kern`_ (:gh:`1327`)
70+
71+
⚕️ Code health
72+
^^^^^^^^^^^^^^
73+
74+
- Keep MNE-BIDS up to date with recent changes on participant birthday date handling in MNE-Python, by `Eric Larson`_ (:gh:`1278`)
75+
- Make rules for linting more strict, make quality assessment exceptions less permissive, by `Stefan Appelhoff`_ (:gh:`1283`)
76+
- Updates to use ``intersphinx_registry`` and sorting TOML files, by `Mathieu Scheltienne`_ (:gh:`1314`)
77+
- Fix dropdown menu in website, by `Scott Huberty`_ (:gh:`1298`)
78+
1079
.. _changes_0_15:
1180

1281
Version 0.15 (2024-06-04)
@@ -1179,5 +1248,4 @@ People who contributed to this release (in alphabetical order):
11791248
* `Stefan Appelhoff`_
11801249
* `Teon Brooks`_
11811250

1182-
11831251
.. include:: authors.rst

examples/anonymize_dataset.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
# To ensure results are reproducible across runs, you can pass the
195195
# ``random_state`` parameter, causing the random number generator to produce
196196
# the same results every time you execute the function. This may come in handy
197-
# e.g. in situations where you discover a problem with the data while working
197+
# in situations where you discover a problem with the data while working
198198
# with the anonymized dataset, fix the issue in the original dataset, and
199199
# run anonymization again.
200200
#
@@ -203,6 +203,15 @@
203203
# in a dataset with multiple subjects will the effects of randomly-picked IDs
204204
# become apparent.)
205205
#
206+
# A good random seed is truly random. Avoid using random seeds from popular
207+
# culture, like "42", or "1337". To obtain a truly random seed, you can paste
208+
# the following into your console:
209+
# ``python -c "import secrets; print(secrets.randbits(31))"``
210+
# Here, 31 bits correspond to the maximum seed "size" that the the legacy
211+
# ``RandomState`` by NumPy, which many scientific libraries still rely on,
212+
# can accept. For more information, see also this blog post on
213+
# `NumPy RNG best practices <https://blog.scientific-python.org/numpy/numpy-rng/>`_.
214+
#
206215
# .. note::
207216
# Passing ``random_state`` merely guarantees that subject IDs and time shift
208217
# remain the same across anonymization runs if the original dataset
@@ -218,6 +227,6 @@
218227
bids_root_in=bids_root,
219228
bids_root_out=bids_root_anon,
220229
datatypes="meg",
221-
random_state=42,
230+
random_state=293201004,
222231
)
223232
print_dir_tree(bids_root_anon)

0 commit comments

Comments
 (0)