Skip to content

Commit

Permalink
bump required mne version (#1361)
Browse files Browse the repository at this point in the history
  • Loading branch information
sappelhoff authored Jan 1, 2025
1 parent 5a83197 commit 8334fc6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 25 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,14 @@ jobs:
- name: Install MNE (stable)
if: matrix.mne-version == 'mne-stable'
run: |
git clone --single-branch --branch maint/1.8 https://github.com/mne-tools/mne-python.git
git clone --single-branch --branch maint/1.9 https://github.com/mne-tools/mne-python.git
python -m pip install -e ./mne-python
- name: Install MNE (previous stable)
if: matrix.mne-version == 'mne-prev-stable'
# Have to install NumPy<2.1 here because of a change in positional arg handling + MNE 1.7
# XXX: drop when mne < 1.8 is no longer supported
run: |
git clone --single-branch --branch maint/1.7 https://github.com/mne-tools/mne-python.git
python -m pip install -e ./mne-python "numpy<2.1"
git clone --single-branch --branch maint/1.8 https://github.com/mne-tools/mne-python.git
python -m pip install -e ./mne-python
- name: Install MNE (main)
if: matrix.mne-version == 'mne-main'
Expand Down
8 changes: 4 additions & 4 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ Dependencies

Required:

* ``mne`` (>=1.7)
* ``numpy`` (>=1.21.2)
* ``scipy`` (>=1.7.1)
* ``mne`` (>=1.8)
* ``numpy`` (>=1.23)
* ``scipy`` (>=1.9)

Optional:

* ``nibabel`` (>=3.2.1, for processing MRI data)
* ``pybv`` (>=0.7.5, for writing BrainVision data)
* ``eeglabio`` (>=0.0.2, for writing EEGLAB data)
* ``pymatreader`` (for other operations with EEGLAB data)
* ``matplotlib`` (>=3.5.0, for using the interactive data inspector)
* ``matplotlib`` (>=3.6, for using the interactive data inspector)
* ``pandas`` (>=1.3.2, for generating event statistics)
* ``edfio`` (>=0.2.1, for writing EDF data)
* ``defusedxml`` (for writing reading EGI MFF data and BrainVision montages)
Expand Down
2 changes: 1 addition & 1 deletion doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Detailed list of changes
🛠 Requirements
^^^^^^^^^^^^^^^

- Nothing yet
- MNE-BIDS now requires ``mne`` 1.8 or higher.

🪲 Bug fixes
^^^^^^^^^^^^
Expand Down
13 changes: 4 additions & 9 deletions mne_bids/tests/test_write.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# SPDX-License-Identifier: BSD-3-Clause

import codecs
import inspect
import json
import os
import os.path as op
Expand Down Expand Up @@ -103,7 +102,7 @@

def _wrap_read_raw(read_raw):
def fn(fname, *args, **kwargs):
if Path(fname).suffix == ".mff" and check_version("mne", "1.8"):
if Path(fname).suffix == ".mff":
kwargs["events_as_annotations"] = True
raw = read_raw(fname, *args, **kwargs)
raw.info["line_freq"] = 60
Expand Down Expand Up @@ -226,8 +225,7 @@ def test_write_participants(_bids_validate, tmp_path):
# add fake participants data
raw.set_meas_date(datetime(year=1994, month=1, day=26, tzinfo=timezone.utc))
birthday = (1993, 1, 26)
if check_version("mne", "1.8"):
birthday = date(*birthday)
birthday = date(*birthday)
raw.info["subject_info"] = {
"his_id": subject_id2,
"birthday": birthday,
Expand Down Expand Up @@ -636,9 +634,7 @@ def test_fif(_bids_validate, tmp_path):
)
assert_array_almost_equal(raw.get_data(), raw2.get_data())
kwargs = dict()
# XXX: remove logic once support for mne<1.8 is dropped
if "copy" in inspect.getfullargspec(epochs.get_data).kwonlyargs:
kwargs["copy"] = False
kwargs["copy"] = False
assert_array_almost_equal(
epochs.get_data(**kwargs),
epochs2.get_data(**kwargs),
Expand Down Expand Up @@ -727,8 +723,7 @@ def test_fif(_bids_validate, tmp_path):
# change the gender but don't force overwrite.
raw = _read_raw_fif(raw_fname)
birthday = (1994, 1, 26)
if check_version("mne", "1.8"):
birthday = date(*birthday)
birthday = date(*birthday)
raw.info["subject_info"] = {
"his_id": subject_id2,
"birthday": birthday,
Expand Down
4 changes: 1 addition & 3 deletions mne_bids/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import sys
import warnings
from collections import OrderedDict, defaultdict
from datetime import date, datetime, timedelta, timezone
from datetime import datetime, timedelta, timezone
from pathlib import Path

import mne
Expand Down Expand Up @@ -479,8 +479,6 @@ def _participants_tsv(raw, subject_id, fname, overwrite=False):

# determine the age of the participant
age = subject_info.get("birthday", None)
if isinstance(age, tuple): # XXX: can be removed once MNE >= 1.8 is required
age = date(*age)
meas_date = raw.info.get("meas_date", None)
if isinstance(meas_date, tuple | list | np.ndarray):
meas_date = meas_date[0]
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
]
dependencies = ["mne>=1.7", "numpy>=1.21.2", "scipy>=1.7.1"]
dependencies = ["mne>=1.8", "numpy>=1.23", "scipy>=1.9"]
description = "MNE-BIDS: Organizing MEG, EEG, and iEEG data according to the BIDS specification and facilitating their analysis with MNE-Python"
dynamic = ["version"]
keywords = [
Expand Down Expand Up @@ -64,14 +64,14 @@ full = [
"defusedxml", # For reading EGI MFF data and BrainVision montages
"edfio >= 0.2.1",
"eeglabio >= 0.0.2",
"matplotlib >= 3.5.0",
"matplotlib >= 3.6",
"nibabel >= 3.2.1",
"pandas >= 1.3.2",
"pybv >= 0.7.5",
"pymatreader",
]
# Dependencies for running the test infrastructure
test = ["mne_bids[full]", "pytest >= 8", "pytest-cov", "pytest-sugar", "ruff"]
test = ["mne_bids[full]", "pytest", "pytest-cov", "pytest-sugar", "ruff"]

[project.urls]
"Bug Tracker" = "https://github.com/mne-tools/mne-bids/issues/"
Expand Down

0 comments on commit 8334fc6

Please sign in to comment.