Skip to content

Commit d6320e9

Browse files
authored
MAINT: Complete deprecations (#13504)
1 parent 09905e5 commit d6320e9

File tree

5 files changed

+10
-20
lines changed

5 files changed

+10
-20
lines changed

mne/export/tests/test_export.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,9 @@ def test_export_raw_edf_does_not_fail_on_empty_header_fields(tmp_path):
536536
raw.export(tmp_path / "test.edf", add_ch_type=True)
537537

538538

539-
@pytest.mark.skipif(not check_version("eeglabio", "0.1.2"), reason="fixed by 0.1.2")
539+
@pytest.mark.skipif(
540+
not check_version("eeglabio", "0.1.2"), reason="fixed by eeglabio 0.1.2"
541+
)
540542
@pytest.mark.parametrize("preload", (True, False))
541543
def test_export_epochs_eeglab(tmp_path, preload):
542544
"""Test saving an Epochs instance to EEGLAB's set format."""
@@ -581,7 +583,6 @@ def test_export_epochs_eeglab(tmp_path, preload):
581583
epochs.export(Path(temp_fname), overwrite=True)
582584

583585

584-
@pytest.mark.filterwarnings("ignore::FutureWarning")
585586
@testing.requires_testing_data
586587
@pytest.mark.parametrize("fmt", ("auto", "mff"))
587588
@pytest.mark.parametrize("do_history", (True, False))
@@ -640,7 +641,6 @@ def test_export_evokeds_to_mff(tmp_path, fmt, do_history):
640641
evoked[0].export(export_fname, overwrite=True)
641642

642643

643-
@pytest.mark.filterwarnings("ignore::FutureWarning")
644644
@testing.requires_testing_data
645645
def test_export_to_mff_no_device():
646646
"""Test no device type throws ValueError."""
@@ -652,7 +652,6 @@ def test_export_to_mff_no_device():
652652
export_evokeds("output.mff", evoked)
653653

654654

655-
@pytest.mark.filterwarnings("ignore::FutureWarning")
656655
def test_export_to_mff_incompatible_sfreq():
657656
"""Test non-whole number sampling frequency throws ValueError."""
658657
pytest.importorskip("mffpy", "0.5.7")

mne/forward/_field_interpolation.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from ..fixes import _safe_svd
2323
from ..surface import get_head_surf, get_meg_helmet_surf
2424
from ..transforms import _find_trans, transform_surface_to
25-
from ..utils import _check_fname, _check_option, _pl, _reg_pinv, logger, verbose, warn
25+
from ..utils import _check_fname, _check_option, _pl, _reg_pinv, logger, verbose
2626
from ._lead_dots import (
2727
_do_cross_dots,
2828
_do_self_dots,
@@ -444,11 +444,11 @@ def make_field_map(
444444
subject=None,
445445
subjects_dir=None,
446446
ch_type=None,
447+
*,
447448
mode="fast",
448449
meg_surf="helmet",
449-
origin=None,
450+
origin="auto",
450451
n_jobs=None,
451-
*,
452452
upsampling=1,
453453
head_source=("bem", "head"),
454454
verbose=None,
@@ -504,15 +504,6 @@ def make_field_map(
504504
The surface maps to be used for field plots. The list contains
505505
separate ones for MEG and EEG (if both MEG and EEG are present).
506506
"""
507-
if origin is None:
508-
warn_message = (
509-
'Default value for origin is "(0.0, 0.0, 0.04)" in version 1.11 '
510-
'but will be changed to "auto" in 1.12. Set the origin parameter '
511-
"explicitly to avoid this warning."
512-
)
513-
warn(warn_message, FutureWarning)
514-
origin = (0.0, 0.0, 0.04)
515-
516507
info = evoked.info
517508

518509
if ch_type is None:

mne/report/report.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
_import_nibabel,
5555
_path_like,
5656
_pl,
57+
_record_warnings,
5758
_safe_input,
5859
_validate_type,
5960
_verbose_safe_false,
@@ -3501,9 +3502,8 @@ def _add_raw(
35013502
init_kwargs, plot_kwargs = _split_psd_kwargs(kwargs=add_psd)
35023503
init_kwargs.setdefault("fmax", fmax)
35033504
plot_kwargs.setdefault("show", False)
3504-
with warnings.catch_warnings():
3505+
with _record_warnings():
35053506
# SciPy warning about too short a data segment given the window size
3506-
warnings.simplefilter(action="ignore", category=FutureWarning)
35073507
fig = raw.compute_psd(**init_kwargs).plot(**plot_kwargs)
35083508
self._add_figure(
35093509
fig=fig,

mne/source_space/_source_space.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2824,7 +2824,7 @@ def _do_src_distances(con, vertno, run_inds, limit):
28242824
return d, min_idx, min_dist
28252825

28262826

2827-
# XXX this should probably be deprecated because it returns surface Labels,
2827+
# XXX this should probably be removed because it returns surface Labels,
28282828
# and probably isn't the way to go moving forward
28292829
# XXX this also assumes that the first two source spaces are surf without
28302830
# checking, which might not be the case (could be all volumes)

tools/dev/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ clean:
2727
@rm bug-reports-12-to-2-months-old.json || true
2828

2929
dep:
30-
cd ../../ && git grep -iI "\(deprecat\|futurewarning\)" -- ':!*.js' ':!*/conftest.py' ':!*/docs.py' ':!*/test_docs.py' ':!*/utils/__init__.pyi' mne/
30+
cd ../../ && git grep -iI "\(deprecat\|futurewarning\|TODO VERSION\)" -- ':!*.js' ':!*/conftest.py' ':!*/docs.py' ':!*/test_docs.py' ':!*/utils/__init__.pyi' mne/

0 commit comments

Comments
 (0)