Skip to content

Commit

Permalink
Backport PR #12661 on branch maint/1.7 (Fix EDF/BDF filter warning bu…
Browse files Browse the repository at this point in the history
…g) (#12666)

Co-authored-by: Clemens Brunner <clemens.brunner@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
  • Loading branch information
3 people committed Jun 14, 2024
1 parent e2c8010 commit 663d741
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 37 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ on: # yamllint disable-line rule:truthy
release:
types: [published]
push:
branches:
- main
branches: ["main", "maint/*"]
pull_request:
branches:
- main
branches: ["main", "maint/*"]

permissions:
contents: read
Expand Down
6 changes: 3 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cff-version: 1.2.0
title: "MNE-Python"
message: "If you use this software, please cite both the software itself, and the paper listed in the preferred-citation field."
version: 1.7.0
date-released: "2024-04-19"
commit: a3743420a8eef774dafd2908f0de89c4d37fcd01
version: 1.7.1
date-released: "2024-06-14"
commit: 7c00b56d077eaf6a2ca691eadd567d974865a03c
doi: 10.5281/zenodo.592483
keywords:
- MEG
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ stages:
displayName: 'PyQt6'
- bash: |
set -e
python -m pip install "PySide6!=6.7.0"
python -m pip install "PySide6!=6.7.0,!=6.7.1"
mne sys_info -pd
mne sys_info -pd | grep "qtpy .* (PySide6=.*)$"
PYTEST_QT_API=PySide6 pytest -m "not slowtest" ${TEST_OPTIONS}
Expand Down
6 changes: 3 additions & 3 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"codeRepository": "git+https://github.com/mne-tools/mne-python.git",
"dateCreated": "2010-12-26",
"datePublished": "2014-08-04",
"dateModified": "2024-04-19",
"downloadUrl": "https://github.com/mne-tools/mne-python/archive/v1.7.0.zip",
"dateModified": "2024-06-14",
"downloadUrl": "https://github.com/mne-tools/mne-python/archive/v1.7.1.zip",
"issueTracker": "https://github.com/mne-tools/mne-python/issues",
"name": "MNE-Python",
"version": "1.7.0",
"version": "1.7.1",
"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.",
"applicationCategory": "Neuroscience",
"developmentStatus": "active",
Expand Down
1 change: 0 additions & 1 deletion doc/changes/devel/12633.bugfix.rst

This file was deleted.

17 changes: 17 additions & 0 deletions doc/changes/v1.7.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
.. _changes_1_7_1:

1.7.1 (2024-06-14)
==================

Bugfixes
--------

- 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>`__)
- Fix incorrect RuntimeWarning (different channel filter settings) in EDF/BDF import, by `Clemens Brunner`_. (`#12661 <https://github.com/mne-tools/mne-python/pulls/12661>`__)

Authors
-------

* Clemens Brunner
* Thomas Binns

.. _changes_1_7_0:

1.7.0 (2024-04-19)
Expand Down
2 changes: 2 additions & 0 deletions mne/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ def pytest_configure(config):
ignore:np\.find_common_type is deprecated.*:DeprecationWarning
# pyvista <-> NumPy 2.0
ignore:__array_wrap__ must accept context and return_scalar arguments.*:DeprecationWarning
# sklearn
ignore:'multi_class' was deprecated.*:FutureWarning
""" # noqa: E501
for warning_line in warning_lines.split("\n"):
warning_line = warning_line.strip()
Expand Down
3 changes: 2 additions & 1 deletion mne/io/edf/edf.py
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ def _get_info(
info["subject_info"]["weight"] = float(edf_info["subject_info"]["weight"])

# Filter settings
if filt_ch_idxs := [x for x in sel if x not in stim_channel_idxs]:
if filt_ch_idxs := [x for x in range(len(sel)) if x not in stim_channel_idxs]:
_set_prefilter(info, edf_info, filt_ch_idxs, "highpass")
_set_prefilter(info, edf_info, filt_ch_idxs, "lowpass")

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

ch_names = [ch_names[idx] for idx in sel]
ch_types = [ch_types[idx] for idx in sel]
units = [units[idx] for idx in sel]

if not exclude_after_unique:
Expand Down
36 changes: 17 additions & 19 deletions mne/io/edf/tests/test_edf.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,26 +175,24 @@ def test_bdf_data():
# XXX BDF data for these is around 0.01 when it should be in the uV range,
# probably some bug
test_scaling = False
with pytest.warns(RuntimeWarning, match="Channels contain different"):
raw_py = _test_raw_reader(
read_raw_bdf,
input_fname=bdf_path,
eog=eog,
misc=misc,
exclude=["M2", "IEOG"],
test_scaling=test_scaling,
)
raw_py = _test_raw_reader(
read_raw_bdf,
input_fname=bdf_path,
eog=eog,
misc=misc,
exclude=["M2", "IEOG"],
test_scaling=test_scaling,
)
assert len(raw_py.ch_names) == 71
with pytest.warns(RuntimeWarning, match="Channels contain different"):
raw_py = _test_raw_reader(
read_raw_bdf,
input_fname=bdf_path,
montage="biosemi64",
eog=eog,
misc=misc,
exclude=["M2", "IEOG"],
test_scaling=test_scaling,
)
raw_py = _test_raw_reader(
read_raw_bdf,
input_fname=bdf_path,
montage="biosemi64",
eog=eog,
misc=misc,
exclude=["M2", "IEOG"],
test_scaling=test_scaling,
)
assert len(raw_py.ch_names) == 71
assert "RawEDF" in repr(raw_py)
picks = pick_types(raw_py.info, meg=False, eeg=True, exclude="bads")
Expand Down
7 changes: 4 additions & 3 deletions mne/io/fiff/tests/test_raw_fiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
fif_bad_marked_fname = base_dir / "test_withbads_raw.fif"
bad_file_works = base_dir / "test_bads.txt"
bad_file_wrong = base_dir / "test_wrong_bads.txt"
hp_fname = base_dir / "test_chpi_raw_hp.txt"
hp_fif_fname = base_dir / "test_chpi_raw_sss.fif"


Expand Down Expand Up @@ -695,12 +694,14 @@ def test_bids_split_files(tmp_path):
with pytest.raises(ValueError, match="Passing a BIDSPath"):
raw.save(bids_path, **save_kwargs)
bids_path.split = None
want_paths = [Path(bids_path.copy().update(split=ii).fpath) for ii in range(1, 3)]
want_paths = [
Path(bids_path.copy().update(split=f"{ii:02d}").fpath) for ii in range(1, 3)
]
for want_path in want_paths:
assert not want_path.is_file()
raw.save(bids_path, **save_kwargs)
for want_path in want_paths:
assert want_path.is_file()
assert want_path.is_file(), want_path


def _err(*args, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "hatchling.build"
[project]
name = "mne"
description = "MNE-Python project for MEG and EEG data analysis."
version = "1.7.0"
version = "1.7.1"
authors = [
{ name = "Alexandre Gramfort", email = "alexandre.gramfort@inria.fr" },
]
Expand Down
3 changes: 2 additions & 1 deletion tools/generate_codemeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def parse_name(name):
args = ["git", "shortlog", "-nse"]
result = subprocess.run(args, capture_output=True, text=True)
lines = result.stdout.strip().split("\n")
all_names = [parse_name(line) for line in lines if "[bot]" not in line]
exclude = ["[bot]", "Lumberbot (aka Jack)"]
all_names = [parse_name(line) for line in lines if not any(x in line for x in exclude)]


# CONSTRUCT JSON AUTHORS LIST
Expand Down

0 comments on commit 663d741

Please sign in to comment.