Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff authored Jul 30, 2024
2 parents f101984 + b7a2aec commit d6522ae
Show file tree
Hide file tree
Showing 71 changed files with 622 additions and 440 deletions.
8 changes: 7 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ jobs:
name: Build the documentation
no_output_timeout: 30m
command: |
make build-doc
make build-doc 2>&1 | tee sphinx_log.txt
- run:
name: Check sphinx log for warnings (which are treated as errors)
when: always
command: |
! grep "^.*WARNING: .*$" sphinx_log.txt
- persist_to_workspace:
root: doc/_build
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Upload a Python Package using Twine when a release is created

name: build
on: # yamllint disable-line rule:truthy
release:
types: [published]
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: read

jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- run: python -m build --sdist --wheel
- run: twine check --strict dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist

pypi-upload:
needs: package
runs-on: ubuntu-latest
if: github.event_name == 'release'
permissions:
id-token: write # for trusted publishing
environment:
name: pypi
url: https://pypi.org/p/mne
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release'
33 changes: 32 additions & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ concurrency:
on:
push:
branches: ['**']
tags: ['**']
pull_request:
branches: ['**']
schedule:
Expand Down Expand Up @@ -203,7 +204,7 @@ jobs:
- name: Install MNE (previous stable)
if: matrix.mne-version == 'mne-prev-stable'
run: |
git clone --single-branch --branch maint/1.5 https://github.com/mne-tools/mne-python.git
git clone --single-branch --branch maint/1.6 https://github.com/mne-tools/mne-python.git
python -m pip install -e ./mne-python
- name: Install MNE (main)
Expand Down Expand Up @@ -289,3 +290,33 @@ jobs:
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml

build_docs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: build_docs-0-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade https://github.com/mne-tools/mne-python/archive/refs/heads/main.zip
python -m pip install -e .[test,doc]
- name: Build the documentation
run: |
make build-doc
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: documentation
path: doc/_build/html
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.5
rev: v0.5.5
hooks:
- id: ruff
name: ruff mne_bids/
files: ^mne_bids/
args: ["--fix"]
- id: ruff
name: ruff examples/
# D103: missing docstring in public function
Expand Down
4 changes: 4 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ authors:
family-names: Wolter
orcid: 'https://orcid.org/0000-0002-6785-9886'
affiliation: 'Centre for Integrative Neuroscience, Tübingen, Germany'
- given-names: Julius
family-names: Welzel
affiliation: 'Department of Neurology, Kiel University, Germany'
orcid: 'https://orcid.org/0000-0003-4782-5360'
- given-names: Alexandre
family-names: Gramfort
affiliation: 'Université Paris-Saclay, Inria, CEA, Palaiseau, France'
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2018-2023, mne-bids developers
Copyright (c) 2017, The MNE-BIDS developers
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
9 changes: 7 additions & 2 deletions doc/_static/versions.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
[
{
"name": "0.15 (devel)",
"name": "0.16 (devel)",
"version": "dev",
"url": "https://mne.tools/mne-bids/dev/"
},
{
"name": "0.14 (stable)",
"name": "0.15 (stable)",
"version": "stable",
"url": "https://mne.tools/mne-bids/v0.15/"
},
{
"name": "0.14",
"version": "0.14",
"url": "https://mne.tools/mne-bids/v0.14/"
},
{
Expand Down
3 changes: 2 additions & 1 deletion doc/authors.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@
.. _Daniel McCloy: http://dan.mccloy.info
.. _Moritz Gerster: http://moritz-gerster.com
.. _Laetitia Fesselier: https://github.com/laemtl
.. _Jonathan Vanhoecke: https://github.com/JonathanVHoecke
.. _Jonathan Vanhoecke: https://sfb-retune.de/people/jonathan-vanhoecke/
.. _Ford McDonald: https://github.com/fordmcdonald
.. _Pierre Guetschel: https://github.com/PierreGtch
.. _Mara Wolter: https://github.com/marakw
.. _Amaia Benitez: https://github.com/AmaiaBA
.. _Julius Welzel: https://github.com/JuliusWelzel
12 changes: 7 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
"""Configure details for documentation with sphinx."""

# Authors: The MNE-BIDS developers
# SPDX-License-Identifier: BSD-3-Clause

import os
import sys
from datetime import date

import sphinx_gallery # noqa: F401
from sphinx.config import is_serializable

import mne_bids


# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down Expand Up @@ -92,10 +94,10 @@

# General information about the project.
project = "MNE-BIDS"
td = date.today()
copyright = "2017-%s, MNE Developers. Last updated on %s" % (td.year, td.isoformat())
today = date.today().isoformat()
copyright = f"2017, The MNE-BIDS developers. Last updated on {today}" # noqa: A001

author = "MNE Developers"
author = "The MNE-BIDS developers"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
2 changes: 1 addition & 1 deletion doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Dependencies

Required:

* ``mne`` (>=1.5)
* ``mne`` (>=1.6)
* ``numpy`` (>=1.21.2)
* ``scipy`` (>=1.7.0)

Expand Down
22 changes: 10 additions & 12 deletions doc/sphinxext/gen_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
Inspired by MNE-Python's `gen_commands.py`
see: github.com/mne-tools/mne-python/blob/main/doc/sphinxext/gen_commands.py
"""
# Authors: Eric Larson <[email protected]>
# Alexandre Gramfort <[email protected]>
# Stefan Appelhoff <[email protected]>
#
# License: BSD-3-Clause

# Authors: The MNE-BIDS developers
# SPDX-License-Identifier: BSD-3-Clause

import glob
import os
import shutil
Expand Down Expand Up @@ -44,14 +43,14 @@ def setup(app):

command_rst = """
.. _gen_%s:
.. _gen_{0}:
%s
%s
{1}
{2}
.. rst-class:: callout
%s
{3}
"""

Expand Down Expand Up @@ -92,7 +91,7 @@ def generate_cli_rst(app=None):
# Add code styling for the "Usage: " line
for li, line in enumerate(output):
if line.startswith("Usage: mne_bids "):
output[li] = "Usage: ``%s``" % line[7:]
output[li] = f"Usage: ``{line[7:]}``"
break

# Turn "Options:" into field list
Expand All @@ -105,8 +104,7 @@ def generate_cli_rst(app=None):
output.insert(ii + 4, "")
output = "\n".join(output)
f.write(
command_rst
% (
command_rst.format(
cmd_name,
cmd_name.replace("mne_bids_", "mne_bids "),
"=" * len(cmd_name),
Expand Down
4 changes: 4 additions & 0 deletions doc/sphinxext/gh_substitutions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
https://doughellmann.com/blog/2010/05/09/defining-custom-roles-in-sphinx/
"""

# Authors: The MNE-BIDS developers
# SPDX-License-Identifier: BSD-3-Clause

from docutils.nodes import reference
from docutils.parsers.rst.roles import set_classes

Expand Down
41 changes: 11 additions & 30 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,25 @@
What's new?
===========

.. _changes_0_15:
.. _changes_0_16:

Version 0.15 (unreleased)
Version 0.16 (unreleased)
-------------------------

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

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

* `Amaia Benitez`_
* `Daniel McCloy`_
* `Mara Wolter`_
* `Amaia Benitez`_


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

* `Alex Rockhill`_
* `Daniel McCloy`_
* `Eric Larson`_
* `Laetitia Fesselier`_
* `Richard Höchenberger`_
* `Stefan Appelhoff`_

Detailed list of changes
Expand All @@ -40,21 +39,13 @@ Detailed list of changes
🧐 API and behavior changes
^^^^^^^^^^^^^^^^^^^^^^^^^^^

- The experimental support for running MNE-BIDS examples from your browser using Binder has
been removed, by `Stefan Appelhoff`_ (:gh:`1202`)
- MNE-BIDS will no longer zero-pad ("zfill") entity indices passed to :class:`~mne_bids.BIDSPath`.
For example, If ``run=1`` is passed to MNE-BIDS, it will no longer be silently auto-converted to ``run-01``, by `Alex Rockhill`_ (:gh:`1215`)
- MNE-BIDS will no longer warn about missing leading punctuation marks for extensions passed :class:`~mne_bids.BIDSPath`.
For example, MNE-BIDS will now silently auto-convert ``edf`` to ```.edf``, by `Alex Rockhill`_ (:gh:`1215`)
- :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`)

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

- MNE-BIDS now requires Python 3.9 or higher.
- MNE-BIDS now requires MNE-Python 1.5.0 or higher.
- ``edfio`` replaces ``EDFlib-Python`` for export to EDF with MNE-Python >= 1.7.0.
- Installing ``mne-bids[full]`` will now also install ``defusedxml`` on all platforms.
- Version requirements for optional dependency packages have been bumped up, see installation instructions.
- MNE-BIDS now requires MNE-Python 1.6.0 or higher.

🪲 Bug fixes
^^^^^^^^^^^^
Expand All @@ -65,23 +56,13 @@ Detailed list of changes
when renaming the files of a .ds folder, by `Mara Wolter`_ (:gh:`1230`)
- We fixed handling of time zones when reading ``*_scans.tsv`` files; specifically, non-UTC timestamps are now processed correctly,
by `Stefan Appelhoff`_ and `Richard Höchenberger`_ (:gh:`1240`)
- Fixed KeyError in ``write_raw_bids()`` for OPM data by including additional OPM channels in ``get_coil_types()`` by `Amaia Benitez`_ (:gh:`1222`)
- 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`)

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

- The configuration of MNE-BIDS has been consolidated from several files (e.g., ``setup.cfg``,
``setup.py``, ``requirements.txt``) and is now specified in a standard ``pyproject.toml``
file, by `Stefan Appelhoff`_ (:gh:`1202`)
- Linting and code formatting is now done entirely using ``ruff``. Previously used tools
(e.g., ``flake8``, ``black``) have been fully replaced, by `Stefan Appelhoff`_ (:gh:`1203`)
- The package build backend has been switched from ``setuptools`` to ``hatchling``. This
only affects users who build and install MNE-BIDS from source, and should not lead to
changed runtime behavior, by `Richard Höchenberger`_ (:gh:`1204`)
- Display of the version number on the website is now truncated for over-long version strings,
by `Daniel McCloy`_ (:gh:`1206`)
- The long deprecated ``events_data`` parameter has been fully removed from
:func:`~mne_bids.write_raw_bids` in favor of ``events``, by `Stefan Appelhoff`_ (:gh:`1229`)
- 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:)

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

Expand Down
Loading

0 comments on commit d6522ae

Please sign in to comment.