Skip to content

Commit 663d741

Browse files
meeseeksmachinecbrnrlarsoner
authored
Backport PR #12661 on branch maint/1.7 (Fix EDF/BDF filter warning bug) (#12666)
Co-authored-by: Clemens Brunner <[email protected]> Co-authored-by: Eric Larson <[email protected]>
1 parent e2c8010 commit 663d741

File tree

12 files changed

+54
-37
lines changed

12 files changed

+54
-37
lines changed

.github/workflows/release.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,9 @@ on: # yamllint disable-line rule:truthy
55
release:
66
types: [published]
77
push:
8-
branches:
9-
- main
8+
branches: ["main", "maint/*"]
109
pull_request:
11-
branches:
12-
- main
10+
branches: ["main", "maint/*"]
1311

1412
permissions:
1513
contents: read

CITATION.cff

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
cff-version: 1.2.0
22
title: "MNE-Python"
33
message: "If you use this software, please cite both the software itself, and the paper listed in the preferred-citation field."
4-
version: 1.7.0
5-
date-released: "2024-04-19"
6-
commit: a3743420a8eef774dafd2908f0de89c4d37fcd01
4+
version: 1.7.1
5+
date-released: "2024-06-14"
6+
commit: 7c00b56d077eaf6a2ca691eadd567d974865a03c
77
doi: 10.5281/zenodo.592483
88
keywords:
99
- MEG

azure-pipelines.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ stages:
193193
displayName: 'PyQt6'
194194
- bash: |
195195
set -e
196-
python -m pip install "PySide6!=6.7.0"
196+
python -m pip install "PySide6!=6.7.0,!=6.7.1"
197197
mne sys_info -pd
198198
mne sys_info -pd | grep "qtpy .* (PySide6=.*)$"
199199
PYTEST_QT_API=PySide6 pytest -m "not slowtest" ${TEST_OPTIONS}

codemeta.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"codeRepository": "git+https://github.com/mne-tools/mne-python.git",
66
"dateCreated": "2010-12-26",
77
"datePublished": "2014-08-04",
8-
"dateModified": "2024-04-19",
9-
"downloadUrl": "https://github.com/mne-tools/mne-python/archive/v1.7.0.zip",
8+
"dateModified": "2024-06-14",
9+
"downloadUrl": "https://github.com/mne-tools/mne-python/archive/v1.7.1.zip",
1010
"issueTracker": "https://github.com/mne-tools/mne-python/issues",
1111
"name": "MNE-Python",
12-
"version": "1.7.0",
12+
"version": "1.7.1",
1313
"description": "MNE-Python is an open-source Python package for exploring, visualizing, and analyzing human neurophysiological data. It provides methods for data input/output, preprocessing, visualization, source estimation, time-frequency analysis, connectivity analysis, machine learning, and statistics.",
1414
"applicationCategory": "Neuroscience",
1515
"developmentStatus": "active",

doc/changes/devel/12633.bugfix.rst

-1
This file was deleted.

doc/changes/v1.7.rst

+17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
.. _changes_1_7_1:
2+
3+
1.7.1 (2024-06-14)
4+
==================
5+
6+
Bugfixes
7+
--------
8+
9+
- Fix bug where :func:`mne.time_frequency.csd_multitaper`, :func:`mne.time_frequency.csd_fourier`, :func:`mne.time_frequency.csd_array_multitaper`, and :func:`mne.time_frequency.csd_array_fourier` would return cross-spectral densities with the ``fmin`` and ``fmax`` frequencies missing, by `Thomas Binns`_ (`#12633 <https://github.com/mne-tools/mne-python/pulls/12633>`__)
10+
- Fix incorrect RuntimeWarning (different channel filter settings) in EDF/BDF import, by `Clemens Brunner`_. (`#12661 <https://github.com/mne-tools/mne-python/pulls/12661>`__)
11+
12+
Authors
13+
-------
14+
15+
* Clemens Brunner
16+
* Thomas Binns
17+
118
.. _changes_1_7_0:
219

320
1.7.0 (2024-04-19)

mne/conftest.py

+2
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ def pytest_configure(config):
200200
ignore:np\.find_common_type is deprecated.*:DeprecationWarning
201201
# pyvista <-> NumPy 2.0
202202
ignore:__array_wrap__ must accept context and return_scalar arguments.*:DeprecationWarning
203+
# sklearn
204+
ignore:'multi_class' was deprecated.*:FutureWarning
203205
""" # noqa: E501
204206
for warning_line in warning_lines.split("\n"):
205207
warning_line = warning_line.strip()

mne/io/edf/edf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ def _get_info(
706706
info["subject_info"]["weight"] = float(edf_info["subject_info"]["weight"])
707707

708708
# Filter settings
709-
if filt_ch_idxs := [x for x in sel if x not in stim_channel_idxs]:
709+
if filt_ch_idxs := [x for x in range(len(sel)) if x not in stim_channel_idxs]:
710710
_set_prefilter(info, edf_info, filt_ch_idxs, "highpass")
711711
_set_prefilter(info, edf_info, filt_ch_idxs, "lowpass")
712712

@@ -951,6 +951,7 @@ def _read_edf_header(
951951
edf_info["units"] = np.array(edf_info["units"], float)
952952

953953
ch_names = [ch_names[idx] for idx in sel]
954+
ch_types = [ch_types[idx] for idx in sel]
954955
units = [units[idx] for idx in sel]
955956

956957
if not exclude_after_unique:

mne/io/edf/tests/test_edf.py

+17-19
Original file line numberDiff line numberDiff line change
@@ -175,26 +175,24 @@ def test_bdf_data():
175175
# XXX BDF data for these is around 0.01 when it should be in the uV range,
176176
# probably some bug
177177
test_scaling = False
178-
with pytest.warns(RuntimeWarning, match="Channels contain different"):
179-
raw_py = _test_raw_reader(
180-
read_raw_bdf,
181-
input_fname=bdf_path,
182-
eog=eog,
183-
misc=misc,
184-
exclude=["M2", "IEOG"],
185-
test_scaling=test_scaling,
186-
)
178+
raw_py = _test_raw_reader(
179+
read_raw_bdf,
180+
input_fname=bdf_path,
181+
eog=eog,
182+
misc=misc,
183+
exclude=["M2", "IEOG"],
184+
test_scaling=test_scaling,
185+
)
187186
assert len(raw_py.ch_names) == 71
188-
with pytest.warns(RuntimeWarning, match="Channels contain different"):
189-
raw_py = _test_raw_reader(
190-
read_raw_bdf,
191-
input_fname=bdf_path,
192-
montage="biosemi64",
193-
eog=eog,
194-
misc=misc,
195-
exclude=["M2", "IEOG"],
196-
test_scaling=test_scaling,
197-
)
187+
raw_py = _test_raw_reader(
188+
read_raw_bdf,
189+
input_fname=bdf_path,
190+
montage="biosemi64",
191+
eog=eog,
192+
misc=misc,
193+
exclude=["M2", "IEOG"],
194+
test_scaling=test_scaling,
195+
)
198196
assert len(raw_py.ch_names) == 71
199197
assert "RawEDF" in repr(raw_py)
200198
picks = pick_types(raw_py.info, meg=False, eeg=True, exclude="bads")

mne/io/fiff/tests/test_raw_fiff.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
fif_bad_marked_fname = base_dir / "test_withbads_raw.fif"
6161
bad_file_works = base_dir / "test_bads.txt"
6262
bad_file_wrong = base_dir / "test_wrong_bads.txt"
63-
hp_fname = base_dir / "test_chpi_raw_hp.txt"
6463
hp_fif_fname = base_dir / "test_chpi_raw_sss.fif"
6564

6665

@@ -695,12 +694,14 @@ def test_bids_split_files(tmp_path):
695694
with pytest.raises(ValueError, match="Passing a BIDSPath"):
696695
raw.save(bids_path, **save_kwargs)
697696
bids_path.split = None
698-
want_paths = [Path(bids_path.copy().update(split=ii).fpath) for ii in range(1, 3)]
697+
want_paths = [
698+
Path(bids_path.copy().update(split=f"{ii:02d}").fpath) for ii in range(1, 3)
699+
]
699700
for want_path in want_paths:
700701
assert not want_path.is_file()
701702
raw.save(bids_path, **save_kwargs)
702703
for want_path in want_paths:
703-
assert want_path.is_file()
704+
assert want_path.is_file(), want_path
704705

705706

706707
def _err(*args, **kwargs):

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
55
[project]
66
name = "mne"
77
description = "MNE-Python project for MEG and EEG data analysis."
8-
version = "1.7.0"
8+
version = "1.7.1"
99
authors = [
1010
{ name = "Alexandre Gramfort", email = "[email protected]" },
1111
]

tools/generate_codemeta.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ def parse_name(name):
9898
args = ["git", "shortlog", "-nse"]
9999
result = subprocess.run(args, capture_output=True, text=True)
100100
lines = result.stdout.strip().split("\n")
101-
all_names = [parse_name(line) for line in lines if "[bot]" not in line]
101+
exclude = ["[bot]", "Lumberbot (aka Jack)"]
102+
all_names = [parse_name(line) for line in lines if not any(x in line for x in exclude)]
102103

103104

104105
# CONSTRUCT JSON AUTHORS LIST

0 commit comments

Comments
 (0)