Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into rework_mne_bids_pat…
Browse files Browse the repository at this point in the history
…h_match
  • Loading branch information
waldie11 committed Dec 18, 2024
2 parents 2ccdfc9 + 46f284b commit 6aa9511
Show file tree
Hide file tree
Showing 13 changed files with 242 additions and 130 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-python@v5
with:
python-version: '3.12'
Expand All @@ -32,6 +35,7 @@ jobs:
with:
name: dist
path: dist
include-hidden-files: true

pypi-upload:
needs: package
Expand Down
21 changes: 20 additions & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -65,6 +68,9 @@ jobs:
python -m pip install build twine
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Build sdist
run: python -m build --sdist
- name: Check sdist
Expand All @@ -81,6 +87,9 @@ jobs:
run: python -m pip uninstall -y mne-bids

- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Build wheel
run: python -m build --wheel
- name: Check wheel
Expand All @@ -97,6 +106,9 @@ jobs:
run: python -m pip uninstall -y mne-bids

- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Test extras install
run: |
python -m pip install .[full]
Expand Down Expand Up @@ -161,6 +173,9 @@ jobs:
FORCE_COLOR: true
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -275,7 +290,7 @@ jobs:
run: make test

- name: Upload coverage stats to codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -289,6 +304,9 @@ jobs:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -310,3 +328,4 @@ jobs:
with:
name: documentation
path: doc/_build/html
include-hidden-files: true
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
rev: v0.8.2
hooks:
- id: ruff
name: ruff mne_bids/
Expand Down Expand Up @@ -33,7 +33,7 @@ repos:
- id: check-docstring-first

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
rev: v0.24.2
hooks:
- id: toml-sort-fix
files: pyproject.toml
4 changes: 4 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ authors:
family-names: Turner
affiliation: 'Wu Tsai Neurosciences Institute, Stanford University'
orcid: 'https://orcid.org/0000-0001-8639-9769'
- given-names: Christian
family-names: O'Reilly
affiliation: 'Computer Science and Engineering, University of South Carolina'
orcid: 'https://orcid.org/0000-0002-3149-4934'
- 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 @@ -51,3 +51,4 @@
.. _Tom Donoghue: https://github.com/TomDonoghue
.. _William Turner: https://bootstrapbill.github.io/
.. _Yorguin Mantilla: https://github.com/yjmantilla
.. _Christian O'Reilly: https://github.com/christian-oreilly
43 changes: 10 additions & 33 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,74 +7,51 @@
What's new?
===========

.. _changes_0_16:
.. _changes_0_17:

Version 0.16 (2024-11-16)
Version 0.17 (unreleased)
-------------------------

👩🏽‍💻 Authors
~~~~~~~~~~~~~~~

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

* `Aaron Earle-Richardson`_
* `Amaia Benitez`_
* `Kaare Mikkelsen`_
* `Simon Kern`_
* `Thomas Hartmann`_
* `William Turner`_
* `Christian O'Reilly`_

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

* `Daniel McCloy`_
* `Eric Larson`_
* `Mathieu Scheltienne`_
* `Richard Höchenberger`_
* `Scott Huberty`_
* `Stefan Appelhoff`_
* `Daniel McCloy`_

Detailed list of changes
~~~~~~~~~~~~~~~~~~~~~~~~

🚀 Enhancements
^^^^^^^^^^^^^^^

- :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`)
- :func:`mne_bids.write_raw_bids()` can now handle event metadata as a pandas DataFrame, by `Thomas Hartmann`_ (:gh:`1285`)
- :func:`mne_bids.write_raw_bids()` can now handle mne `Raw` objects with `eyegaze` and `pupil` channels, by `Christian O'Reilly`_ (:gh:`1344`)


🧐 API and behavior changes
^^^^^^^^^^^^^^^^^^^^^^^^^^^

- :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`)
- MEG OPM channels are now experimentally included, by `Amaia Benitez`_ (:gh:`1222`)
- :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`)
- :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`)

- Nothing yet

🛠 Requirements
^^^^^^^^^^^^^^^

- MNE-BIDS now requires Python 3.10 or higher.
- MNE-BIDS now requires ``mne`` 1.7 or higher.
- Nothing yet

🪲 Bug fixes
^^^^^^^^^^^^

- Writing MEGIN data with MNE channel types `chpi` will now map to BIDS type HLU by `Simon Kern`_ (:gh:`1325`)
- 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`)
- Dealing with alphanumeric ``sub`` entity labels is now fixed for :func:`~mne_bids.write_raw_bids`, by `Aaron Earle-Richardson`_ (:gh:`1291`)
- 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`)
- Fixed broken links in examples 7 and 8, by `William Turner`_ (:gh:`1316`)
- 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`)
- A warning was given if no events were provided but the task was starting with 'rest' as recommended by `Simon Kern`_ (:gh:`1327`)
- :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`)

⚕️ Code health
^^^^^^^^^^^^^^

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

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

Expand Down
70 changes: 69 additions & 1 deletion doc/whats_new_previous_releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,75 @@
What was new in previous releases?
==================================

.. _changes_0_16:

Version 0.16 (2024-11-16)
-------------------------

👩🏽‍💻 Authors
~~~~~~~~~~~~~~~

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

* `Aaron Earle-Richardson`_
* `Amaia Benitez`_
* `Kaare Mikkelsen`_
* `Simon Kern`_
* `Thomas Hartmann`_
* `William Turner`_

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

* `Daniel McCloy`_
* `Eric Larson`_
* `Mathieu Scheltienne`_
* `Richard Höchenberger`_
* `Scott Huberty`_
* `Stefan Appelhoff`_

Detailed list of changes
~~~~~~~~~~~~~~~~~~~~~~~~

🚀 Enhancements
^^^^^^^^^^^^^^^

- :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`)
- :func:`mne_bids.write_raw_bids()` can now handle event metadata as a pandas DataFrame, by `Thomas Hartmann`_ (:gh:`1285`)

🧐 API and behavior changes
^^^^^^^^^^^^^^^^^^^^^^^^^^^

- :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`)
- MEG OPM channels are now experimentally included, by `Amaia Benitez`_ (:gh:`1222`)
- :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`)
- :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`)


🛠 Requirements
^^^^^^^^^^^^^^^

- MNE-BIDS now requires Python 3.10 or higher.
- MNE-BIDS now requires ``mne`` 1.7 or higher.

🪲 Bug fixes
^^^^^^^^^^^^

- Writing MEGIN data with MNE channel types `chpi` will now map to BIDS type HLU by `Simon Kern`_ (:gh:`1325`)
- 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`)
- Dealing with alphanumeric ``sub`` entity labels is now fixed for :func:`~mne_bids.write_raw_bids`, by `Aaron Earle-Richardson`_ (:gh:`1291`)
- 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`)
- Fixed broken links in examples 7 and 8, by `William Turner`_ (:gh:`1316`)
- 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`)
- A warning was given if no events were provided but the task was starting with 'rest' as recommended by `Simon Kern`_ (:gh:`1327`)

⚕️ Code health
^^^^^^^^^^^^^^

- Keep MNE-BIDS up to date with recent changes on participant birthday date handling in MNE-Python, by `Eric Larson`_ (:gh:`1278`)
- Make rules for linting more strict, make quality assessment exceptions less permissive, by `Stefan Appelhoff`_ (:gh:`1283`)
- Updates to use ``intersphinx_registry`` and sorting TOML files, by `Mathieu Scheltienne`_ (:gh:`1314`)
- Fix dropdown menu in website, by `Scott Huberty`_ (:gh:`1298`)

.. _changes_0_15:

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


.. include:: authors.rst
13 changes: 11 additions & 2 deletions examples/anonymize_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@
# To ensure results are reproducible across runs, you can pass the
# ``random_state`` parameter, causing the random number generator to produce
# the same results every time you execute the function. This may come in handy
# e.g. in situations where you discover a problem with the data while working
# in situations where you discover a problem with the data while working
# with the anonymized dataset, fix the issue in the original dataset, and
# run anonymization again.
#
Expand All @@ -203,6 +203,15 @@
# in a dataset with multiple subjects will the effects of randomly-picked IDs
# become apparent.)
#
# A good random seed is truly random. Avoid using random seeds from popular
# culture, like "42", or "1337". To obtain a truly random seed, you can paste
# the following into your console:
# ``python -c "import secrets; print(secrets.randbits(31))"``
# Here, 31 bits correspond to the maximum seed "size" that the the legacy
# ``RandomState`` by NumPy, which many scientific libraries still rely on,
# can accept. For more information, see also this blog post on
# `NumPy RNG best practices <https://blog.scientific-python.org/numpy/numpy-rng/>`_.
#
# .. note::
# Passing ``random_state`` merely guarantees that subject IDs and time shift
# remain the same across anonymization runs if the original dataset
Expand All @@ -218,6 +227,6 @@
bids_root_in=bids_root,
bids_root_out=bids_root_anon,
datatypes="meg",
random_state=42,
random_state=293201004,
)
print_dir_tree(bids_root_anon)
Loading

0 comments on commit 6aa9511

Please sign in to comment.