Skip to content

Commit 85e6759

Browse files
larsonerdrammock
andauthored
MAINT: Bump mins, deprecations (mne-tools#13322)
Co-authored-by: Daniel McCloy <dan@mccloy.info>
1 parent 3ac330a commit 85e6759

File tree

16 files changed

+125
-135
lines changed

16 files changed

+125
-135
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
persist-credentials: false
3131
- uses: actions/setup-python@v5
3232
with:
33-
python-version: '3.12'
33+
python-version: '3.13'
3434
- uses: pre-commit/action@v3.0.1
3535
- run: pip install mypy numpy scipy vulture
3636
- run: mypy
@@ -70,16 +70,16 @@ jobs:
7070
python: '3.13'
7171
kind: pip
7272
- os: ubuntu-latest
73-
python: '3.12'
73+
python: '3.13'
7474
kind: pip-pre
7575
- os: ubuntu-latest
76-
python: '3.12'
76+
python: '3.13'
7777
kind: conda
7878
- os: macos-latest # arm64 (Apple Silicon)
79-
python: '3.12'
79+
python: '3.13'
8080
kind: mamba
8181
- os: macos-13 # latest Intel release
82-
python: '3.12'
82+
python: '3.13'
8383
kind: mamba
8484
- os: windows-latest
8585
python: '3.10'

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ repos:
7878
language: python
7979
entry: ./tools/hooks/sync_dependencies.py
8080
files: '^(pyproject.toml|tools/hooks/sync_dependencies.py)$'
81-
additional_dependencies: ["mne==1.9.0"]
81+
additional_dependencies: ["mne==1.10.0"]
8282

8383
# zizmor
8484
- repo: https://github.com/woodruffw/zizmor-pre-commit

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ The minimum required dependencies to run MNE-Python are:
7373
.. ↓↓↓ BEGIN CORE DEPS LIST. DO NOT EDIT! HANDLED BY PRE-COMMIT HOOK ↓↓↓
7474
7575
- `Python <https://www.python.org>`__ ≥ 3.10
76-
- `NumPy <https://numpy.org>`__ ≥ 1.23
77-
- `SciPy <https://scipy.org>`__ ≥ 1.9
78-
- `Matplotlib <https://matplotlib.org>`__ ≥ 3.6
76+
- `NumPy <https://numpy.org>`__ ≥ 1.25
77+
- `SciPy <https://scipy.org>`__ ≥ 1.11
78+
- `Matplotlib <https://matplotlib.org>`__ ≥ 3.7
7979
- `Pooch <https://www.fatiando.org/pooch/latest/>`__ ≥ 1.5
8080
- `tqdm <https://tqdm.github.io>`__
8181
- `Jinja2 <https://palletsprojects.com/p/jinja/>`__

environment.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ dependencies:
2525
- jupyter
2626
- lazy_loader >=0.3
2727
- mamba
28-
- matplotlib >=3.7
28+
- matplotlib >=3.8
2929
- mffpy >=0.5.7
3030
- mne-qt-browser
3131
- nibabel
3232
- nilearn
3333
- nomkl
3434
- numba
35-
- numpy >=1.25,<3
36-
- openmeeg >=2.5.5
35+
- numpy >=1.26,<3
36+
- openmeeg >=2.5.7
3737
- packaging
38-
- pandas >=2.0
38+
- pandas >=2.1
3939
- pillow
4040
- pip
4141
- pooch >=1.5

mne/datasets/sleep_physionet/_utils.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# License: BSD-3-Clause
33
# Copyright the MNE-Python contributors.
44

5-
import inspect
65
import os
76
import os.path as op
87

@@ -115,16 +114,13 @@ def _update_sleep_temazepam_records(fname=TEMAZEPAM_SLEEP_RECORDS):
115114
data = data.set_index(("Subject - age - sex", "Nr"))
116115
data.index.name = "subject"
117116
data.columns.names = [None, None]
118-
kwargs = dict()
119-
# TODO VERSION can be removed once we require Pandas 2.1
120-
if "future_stack" in inspect.getfullargspec(pd.DataFrame.stack).args:
121-
kwargs["future_stack"] = True
122117
data = (
123118
data.set_index(
124119
[("Subject - age - sex", "Age"), ("Subject - age - sex", "M1/F2")],
125120
append=True,
126121
)
127-
.stack(level=0, **kwargs)
122+
# TODO VERSION future_stack goes away w/ Pandas 3.0
123+
.stack(level=0, future_stack=True)
128124
.reset_index()
129125
)
130126

mne/preprocessing/maxwell.py

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ def maxwell_filter(
236236
mag_scale=100.0,
237237
skip_by_annotation=("edge", "bad_acq_skip"),
238238
extended_proj=(),
239-
st_overlap=None,
240-
mc_interp=None,
239+
st_overlap=True,
240+
mc_interp="hann",
241241
verbose=None,
242242
):
243243
"""Maxwell filter data using multipole moments.
@@ -287,8 +287,7 @@ def maxwell_filter(
287287
%(extended_proj_maxwell)s
288288
st_overlap : bool
289289
If True (default in 1.11), tSSS processing will use a constant
290-
overlap-add method. If False (default in 1.10), then
291-
non-overlapping windows will be used.
290+
overlap-add method. If False, then non-overlapping windows will be used.
292291
293292
.. versionadded:: 1.10
294293
%(maxwell_mc_interp)s
@@ -456,8 +455,8 @@ def _prep_maxwell_filter(
456455
skip_by_annotation=("edge", "bad_acq_skip"),
457456
extended_proj=(),
458457
reconstruct="in",
459-
st_overlap=False,
460-
mc_interp="zero",
458+
st_overlap=True,
459+
mc_interp="hann",
461460
verbose=None,
462461
):
463462
# There are an absurd number of different possible notations for spherical
@@ -494,25 +493,7 @@ def _prep_maxwell_filter(
494493
)
495494
if st_only and st_duration is None:
496495
raise ValueError("st_duration must not be None if st_only is True")
497-
if st_overlap is None:
498-
if st_duration is not None:
499-
# TODO VERSION 1.10/1.11 deprecation
500-
warn(
501-
"st_overlap defaults to False in 1.10 but will change to "
502-
"True in 1.11. Set it explicitly to avoid this warning.",
503-
DeprecationWarning,
504-
)
505-
st_overlap = False
506-
add_channels = head_pos is not None and not st_only
507-
if mc_interp is None:
508-
if head_pos is not None:
509-
# TODO VERSION 1.10/1.11 deprecation
510-
warn(
511-
'mc_interp defaults to "zero" in 1.10 but will change '
512-
'to "hann" in 1.11, set it explicitly to avoid this '
513-
"message.",
514-
DeprecationWarning,
515-
)
496+
if head_pos is None and mc_interp:
516497
mc_interp = "zero"
517498
add_channels = (head_pos is not None) and (not st_only)
518499
head_pos = _check_pos(head_pos, coord_frame, raw, st_fixed)
@@ -776,7 +757,7 @@ def _run_maxwell_filter(
776757
n = end - onset
777758
assert n > 0
778759
tsss_valid = n >= st_duration
779-
if st_overlap and tsss_valid:
760+
if st_overlap and tsss_valid and st_correlation is not None:
780761
n_overlap = st_duration // 2
781762
window = "hann"
782763
else:
@@ -2555,7 +2536,7 @@ def find_bad_channels_maxwell(
25552536
skip_by_annotation=("edge", "bad_acq_skip"),
25562537
h_freq=40.0,
25572538
extended_proj=(),
2558-
mc_interp=None,
2539+
mc_interp="hann",
25592540
verbose=None,
25602541
):
25612542
r"""Find bad channels using Maxwell filtering.
@@ -2754,6 +2735,7 @@ def find_bad_channels_maxwell(
27542735
extended_proj=extended_proj,
27552736
reconstruct="orig",
27562737
)
2738+
assert params["st_correlation"] is None
27572739
del origin, int_order, ext_order, calibration, cross_talk, coord_frame
27582740
del regularize, ignore_ref, bad_condition, head_pos, mag_scale
27592741
good_meg_picks = params["meg_picks"][params["good_mask"]]

mne/preprocessing/tests/test_fine_cal.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def test_fine_cal_systems(system, tmp_path):
222222
err_limit = 500
223223
n_ref = 3
224224
corrs = (0.58, 0.61, 0.57)
225-
sfs = [0.9, 1.1, 2.1, 2.8]
225+
sfs = [0.9, 1.1, 1.9, 2.8]
226226
corr_tol = 0.3
227227
elif system == "ctf":
228228
raw = read_raw_ctf(ctf_fname_continuous).crop(0, 1)
@@ -242,7 +242,7 @@ def test_fine_cal_systems(system, tmp_path):
242242
err_limit = 15
243243
int_order = 5
244244
corrs = (0.13, 0.0, 0.12)
245-
sfs = [4, 5, 125, 155]
245+
sfs = [4, 5, 125, 157]
246246
corr_tol = 0.38
247247
else:
248248
assert system == "triux", f"Unknown system {system}"
@@ -278,6 +278,8 @@ def test_fine_cal_systems(system, tmp_path):
278278
regularize=None,
279279
bad_condition="ignore",
280280
int_order=int_order,
281+
st_overlap=False,
282+
mc_interp="zero",
281283
)
282284
raw_sss = maxwell_filter(raw, **kwargs)
283285
_assert_shielding(raw_sss, raw, *sfs[0:2])

mne/preprocessing/tests/test_maxwell.py

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,10 +1622,21 @@ def test_mf_skips():
16221622
),
16231623
[
16241624
# Neuromag data tested against MF
1625-
(sample_fname, [], False, False, False, ["MEG 2443"], False, None, "raw"),
1625+
pytest.param(
1626+
sample_fname,
1627+
[],
1628+
False,
1629+
False,
1630+
False,
1631+
["MEG 2443"],
1632+
False,
1633+
None,
1634+
"raw",
1635+
id="Neuromag no bads",
1636+
),
16261637
# add 0111 to test picking, add annot to test it, and prepend chs for
16271638
# idx
1628-
(
1639+
pytest.param(
16291640
sample_fname,
16301641
["MEG 0111"],
16311642
True,
@@ -1635,11 +1646,12 @@ def test_mf_skips():
16351646
False,
16361647
None,
16371648
"raw",
1649+
id="Neuromag with bads and annot",
16381650
),
16391651
# CTF data seems to be sensitive to linalg lib (?) because some
16401652
# channels are very close to the limit, so we just check that one shows
16411653
# up
1642-
(
1654+
pytest.param(
16431655
ctf_fname_continuous,
16441656
[],
16451657
False,
@@ -1649,9 +1661,10 @@ def test_mf_skips():
16491661
False,
16501662
None,
16511663
"raw",
1664+
id="CTF no bads",
16521665
),
16531666
# faked
1654-
(
1667+
pytest.param(
16551668
ctf_fname_continuous,
16561669
[],
16571670
False,
@@ -1661,10 +1674,33 @@ def test_mf_skips():
16611674
False,
16621675
None,
16631676
"raw",
1677+
id="CTF ignore ref",
16641678
),
16651679
# For `return_scores=True`
1666-
(sample_fname, ["MEG 0111"], True, True, False, ["MEG 2443"], True, 50, "raw"),
1667-
(sample_fname, ["MEG 0111"], True, True, False, ["MEG 2443"], True, 50, None),
1680+
pytest.param(
1681+
sample_fname,
1682+
["MEG 0111"],
1683+
True,
1684+
True,
1685+
False,
1686+
["MEG 2443"],
1687+
True,
1688+
50,
1689+
"raw",
1690+
id="Neuromag return scores",
1691+
),
1692+
pytest.param(
1693+
sample_fname,
1694+
["MEG 0111"],
1695+
True,
1696+
True,
1697+
False,
1698+
["MEG 2443"],
1699+
True,
1700+
50,
1701+
None,
1702+
id="Neuromag return scores no meas date",
1703+
),
16681704
],
16691705
)
16701706
def test_find_bad_channels_maxwell(

mne/report/report.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1599,7 +1599,6 @@ def add_inverse_operator(
15991599
*,
16001600
subject=None,
16011601
subjects_dir=None,
1602-
trans=None,
16031602
plot=False,
16041603
tags=("inverse-operator",),
16051604
section=None,
@@ -1619,9 +1618,6 @@ def add_inverse_operator(
16191618
passed on report creation.
16201619
subjects_dir : path-like | None
16211620
The FreeSurfer ``SUBJECTS_DIR``.
1622-
trans : path-like | instance of Transform | None
1623-
Deprecated and will be removed in 1.11.
1624-
The trans stored in the inverse operator will be used instead.
16251621
plot : bool
16261622
If True, plot the source space of the inverse operator.
16271623
@@ -1637,12 +1633,6 @@ def add_inverse_operator(
16371633
.. versionadded:: 0.24.0
16381634
"""
16391635
tags = _check_tags(tags)
1640-
if trans is not None:
1641-
warn(
1642-
"trans is deprecated and will be removed in 1.11, do not pass it "
1643-
"to add_inverse_operator",
1644-
category=FutureWarning,
1645-
)
16461636
self._add_inverse_operator(
16471637
inverse_operator=inverse_operator,
16481638
subject=subject,

mne/utils/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,8 @@ def sys_info(
839839
"edfio",
840840
"mffpy",
841841
"pybv",
842+
"antio",
843+
"defusedxml",
842844
"",
843845
)
844846
if dependencies == "developer":
@@ -847,11 +849,9 @@ def sys_info(
847849
"pytest",
848850
"statsmodels",
849851
"numpydoc",
850-
"flake8",
851852
"jupyter_client",
852853
"nbclient",
853854
"nbformat",
854-
"pydocstyle",
855855
"nitime",
856856
"imageio",
857857
"imageio-ffmpeg",

0 commit comments

Comments
 (0)