Skip to content

Commit e1aa5ed

Browse files
authored
MAINT: Work around pandas deprecation (#13632)
1 parent 1138f8b commit e1aa5ed

5 files changed

Lines changed: 20 additions & 2 deletions

File tree

doc/changes/names.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@
337337
.. _Tom Ma: https://github.com/myd7349
338338
.. _Tom Stone: https://github.com/tomdstone
339339
.. _Tommy Clausner: https://github.com/TommyClausner
340-
.. _Toomas Erik Anijärv: https://www.toomaserikanijarv.com/
340+
.. _Toomas Erik Anijärv: https://github.com/teanijarv
341341
.. _Tristan Stenner: https://github.com/tstenner/
342342
.. _Tziona NessAiver: https://github.com/TzionaN
343343
.. _user27182: https://github.com/user27182

doc/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,7 @@ def fix_sklearn_inherited_docstrings(app, what, name, obj, options, lines):
727727
"http://ilabs.washington.edu",
728728
"https://psychophysiology.cpmc.columbia.edu",
729729
"https://erc.easme-web.eu",
730+
"https://www.crnl.fr",
730731
# Not rendered by linkcheck builder
731732
r"ides\.html",
732733
]

doc/links.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
.. _fwer: https://en.wikipedia.org/wiki/Family-wise_error_rate
4141
.. _fdr: https://en.wikipedia.org/wiki/False_discovery_rate
4242
.. _ft_cluster: http://www.fieldtriptoolbox.org/faq/how_not_to_interpret_results_from_a_cluster-based_permutation_test
43-
.. _ft_cluster_effect_size: https://mailman.science.ru.nl/pipermail/fieldtrip/2017-September/024644.html
43+
.. _ft_cluster_effect_size: https://mailman.science.ru.nl/pipermail/fieldtrip/2017-September/011773.html
4444
.. _ft_exch: https://mailman.science.ru.nl/pipermail/fieldtrip/2008-October/001794.html
4545

4646

doc/sphinxext/mne_doc_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def reset_warnings(gallery_conf, fname):
7272
r"open_text is deprecated\. Use files",
7373
# dipy etc.
7474
"The `disp` and `iprint` options of the L-BFGS-B solver",
75+
# statsmodels<->pandas
76+
"Substitution is deprecated and will be removed",
7577
):
7678
warnings.filterwarnings( # deal with other modules having bad imports
7779
"ignore", message=f".*{key}.*", category=DeprecationWarning

mne/conftest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import numpy as np
2121
import pytest
22+
from packaging.version import Version
2223
from pytest import StashKey, register_assert_rewrite
2324

2425
# Any `assert` statements in our testing functions should be verbose versions
@@ -215,6 +216,20 @@ def pytest_configure(config: pytest.Config):
215216
warning_line = warning_line.strip()
216217
if warning_line and not warning_line.startswith("#"):
217218
config.addinivalue_line("filterwarnings", warning_line)
219+
try:
220+
import pandas
221+
except Exception:
222+
pass
223+
else:
224+
if Version(pandas.__version__) >= Version("3.1.0.dev0"):
225+
# TODO VERSION once statsmodels dev has updated for pip-pre
226+
# (failing as of 2026/02/04)
227+
config.addinivalue_line(
228+
"filterwarnings",
229+
"ignore:"
230+
".+ is deprecated and will be removed in a future version.*:"
231+
"pandas.errors.Pandas4Warning",
232+
)
218233

219234

220235
def pytest_collection_modifyitems(items: list[pytest.Item]):

0 commit comments

Comments
 (0)