From a82528d35c655b693b23143a88850fe7a851fa10 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 19 Aug 2024 00:07:34 -0700 Subject: [PATCH] MAINT: Update installers (#12798) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- .github/workflows/tests.yml | 4 +- README.rst | 16 +-- doc/changes/devel.rst | 5 + doc/changes/devel/12798.dependency.rst | 1 + doc/development/contributing.rst | 4 +- doc/development/whats_new.rst | 1 + doc/install/installers.rst | 10 +- doc/links.inc | 1 + mne/datasets/_fsaverage/base.py | 37 +------ mne/datasets/tests/test_datasets.py | 4 - mne/export/_edf.py | 2 +- mne/fixes.py | 2 +- mne/io/egi/egi.py | 12 +-- mne/io/egi/egimff.py | 2 +- mne/io/egi/tests/test_egi.py | 4 +- mne/time_frequency/tfr.py | 136 +------------------------ mne/utils/_logging.py | 3 +- mne/utils/docs.py | 8 -- mne/viz/_brain/_brain.py | 27 ----- pyproject.toml | 3 +- tools/environment_old.yml | 10 +- 21 files changed, 51 insertions(+), 241 deletions(-) create mode 100644 doc/changes/devel.rst create mode 100644 doc/changes/devel/12798.dependency.rst diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b039f9ddc69..571c3943ae7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -72,10 +72,10 @@ jobs: python: '3.10' kind: mamba - os: ubuntu-latest - python: '3.9' + python: '3.10' kind: minimal - os: ubuntu-20.04 - python: '3.9' + python: '3.10' kind: old steps: - uses: actions/checkout@v4 diff --git a/README.rst b/README.rst index 236bc1287b2..745e74849c3 100644 --- a/README.rst +++ b/README.rst @@ -74,8 +74,8 @@ Dependencies The minimum required dependencies to run MNE-Python are: - `Python `__ ≥ 3.9 -- `NumPy `__ ≥ 1.23 -- `SciPy `__ ≥ 1.9 +- `NumPy `__ ≥ 1.24 +- `SciPy `__ ≥ 1.10 - `Matplotlib `__ ≥ 3.6 - `Pooch `__ ≥ 1.5 - `tqdm `__ @@ -85,8 +85,8 @@ The minimum required dependencies to run MNE-Python are: For full functionality, some functions require: -- `scikit-learn `__ ≥ 1.1 -- `Joblib `__ ≥ 0.15 (for parallelization) +- `scikit-learn `__ ≥ 1.2 +- `Joblib `__ ≥ 1.2 (for parallelization) - `mne-qt-browser `__ ≥ 0.5 (for fast raw data visualization) - `Qt `__ ≥ 5.15 via one of the following bindings (for fast raw data visualization and interactive 3D visualization): @@ -94,16 +94,16 @@ For full functionality, some functions require: - `PyQt6 `__ ≥ 6.0 - `PyQt5 `__ ≥ 5.15 -- `Numba `__ ≥ 0.54.0 +- `Numba `__ ≥ 0.56.4 - `NiBabel `__ ≥ 3.2.1 - `OpenMEEG `__ ≥ 2.5.6 -- `pandas `__ ≥ 1.3.2 +- `pandas `__ ≥ 1.5.2 - `Picard `__ ≥ 0.3 - `CuPy `__ ≥ 9.0.0 (for NVIDIA CUDA acceleration) - `DIPY `__ ≥ 1.4.0 - `imageio `__ ≥ 2.8.0 -- `PyVista `__ ≥ 0.32 (for 3D visualization) -- `PyVistaQt `__ ≥ 0.4 (for 3D visualization) +- `PyVista `__ ≥ 0.37 (for 3D visualization) +- `PyVistaQt `__ ≥ 0.9 (for 3D visualization) - `mffpy `__ ≥ 0.5.7 - `h5py `__ - `h5io `__ diff --git a/doc/changes/devel.rst b/doc/changes/devel.rst new file mode 100644 index 00000000000..0e80d522b51 --- /dev/null +++ b/doc/changes/devel.rst @@ -0,0 +1,5 @@ +.. See doc/development/contributing.rst for description of how to add entries. + +.. _current: + +.. towncrier-draft-entries:: Version |release| (development) diff --git a/doc/changes/devel/12798.dependency.rst b/doc/changes/devel/12798.dependency.rst new file mode 100644 index 00000000000..ef05dab1e8d --- /dev/null +++ b/doc/changes/devel/12798.dependency.rst @@ -0,0 +1 @@ +- Minimum supported dependencies were updated in accordance with SPEC0_, most notably Python 3.10+ is now required. diff --git a/doc/development/contributing.rst b/doc/development/contributing.rst index aec32da00ac..1cca8a8608d 100644 --- a/doc/development/contributing.rst +++ b/doc/development/contributing.rst @@ -242,8 +242,8 @@ Creating the virtual environment These instructions will set up a Python environment that is separated from your system-level Python and any other managed Python environments on your computer. -This lets you switch between different versions of Python (MNE-Python requires -version 3.9 or higher) and also switch between the stable and development +This lets you switch between different versions of Python and also switch between +the stable and development versions of MNE-Python (so you can, for example, use the same computer to analyze your data with the stable release, and also work with the latest development version to fix bugs or add new features). Even if you've already diff --git a/doc/development/whats_new.rst b/doc/development/whats_new.rst index 87246377b9e..75ece13b5e0 100644 --- a/doc/development/whats_new.rst +++ b/doc/development/whats_new.rst @@ -8,6 +8,7 @@ Changes for each version of MNE-Python are listed below. .. toctree:: :maxdepth: 1 + ../changes/devel.rst ../changes/v1.8.rst ../changes/v1.7.rst ../changes/v1.6.rst diff --git a/doc/install/installers.rst b/doc/install/installers.rst index 93de05bd6b1..9f7932e911d 100644 --- a/doc/install/installers.rst +++ b/doc/install/installers.rst @@ -14,7 +14,7 @@ Python packages and tools. Got any questions? Let us know on the `MNE Forum`_! :class-content: text-center :name: linux-installers - .. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.7.1/MNE-Python-1.7.1_0-Linux.sh + .. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.8.0/MNE-Python-1.8.0_0-Linux.sh :ref-type: ref :color: primary :shadow: @@ -28,14 +28,14 @@ Python packages and tools. Got any questions? Let us know on the `MNE Forum`_! .. code-block:: console - $ sh ./MNE-Python-1.7.1_0-Linux.sh + $ sh ./MNE-Python-1.8.0_0-Linux.sh .. tab-item:: macOS (Intel) :class-content: text-center :name: macos-intel-installers - .. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.7.1/MNE-Python-1.7.1_0-macOS_Intel.pkg + .. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.8.0/MNE-Python-1.8.0_0-macOS_Intel.pkg :ref-type: ref :color: primary :shadow: @@ -51,7 +51,7 @@ Python packages and tools. Got any questions? Let us know on the `MNE Forum`_! :class-content: text-center :name: macos-apple-installers - .. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.7.1/MNE-Python-1.7.1_0-macOS_M1.pkg + .. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.8.0/MNE-Python-1.8.0_0-macOS_M1.pkg :ref-type: ref :color: primary :shadow: @@ -67,7 +67,7 @@ Python packages and tools. Got any questions? Let us know on the `MNE Forum`_! :class-content: text-center :name: windows-installers - .. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.7.1/MNE-Python-1.7.1_0-Windows.exe + .. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.8.0/MNE-Python-1.8.0_0-Windows.exe :ref-type: ref :color: primary :shadow: diff --git a/doc/links.inc b/doc/links.inc index 27e61c850bc..b25f5265509 100644 --- a/doc/links.inc +++ b/doc/links.inc @@ -71,6 +71,7 @@ .. _python: http://www.python.org .. _Brain Imaging Data Structure: https://bids.neuroimaging.io/ +.. _SPEC0: https://scientific-python.org/specs/spec-0000 .. python packages diff --git a/mne/datasets/_fsaverage/base.py b/mne/datasets/_fsaverage/base.py index c626c7a5f91..b15a8c7a94c 100644 --- a/mne/datasets/_fsaverage/base.py +++ b/mne/datasets/_fsaverage/base.py @@ -2,10 +2,9 @@ # License: BSD-3-Clause # Copyright the MNE-Python contributors. -import os -from pathlib import Path, PosixPath, WindowsPath +from pathlib import Path -from ...utils import get_subjects_dir, set_config, verbose, warn +from ...utils import get_subjects_dir, set_config, verbose from ..utils import _get_path, _manifest_check_download FSAVERAGE_MANIFEST_PATH = Path(__file__).parent @@ -83,7 +82,7 @@ def fetch_fsaverage(subjects_dir=None, *, verbose=None): url="https://osf.io/7ve8g/download?version=4", hash_="b31509cdcf7908af6a83dc5ee8f49fb1", ) - return _mne_path(fs_dir) + return fs_dir def _get_create_subjects_dir(subjects_dir): @@ -102,33 +101,3 @@ def _set_montage_coreg_path(subjects_dir=None): if old_subjects_dir is None: set_config("SUBJECTS_DIR", subjects_dir) return subjects_dir - - -# Adapted from pathlib.Path.__new__ -def _mne_path(path): - klass = MNEWindowsPath if os.name == "nt" else MNEPosixPath - out = klass(path) - assert isinstance(out, klass) - return out - - -class _PathAdd: - def __add__(self, other): - if isinstance(other, str): - warn( - "data_path functions now return pathlib.Path objects which " - "do not natively support the plus (+) operator, switch to " - "using forward slash (/) instead. Support for plus will be " - "removed in 1.2.", - FutureWarning, - ) - return f"{str(self)}{other}" - raise NotImplementedError - - -class MNEWindowsPath(_PathAdd, WindowsPath): # noqa: D101 - pass - - -class MNEPosixPath(_PathAdd, PosixPath): # noqa: D101 - pass diff --git a/mne/datasets/tests/test_datasets.py b/mne/datasets/tests/test_datasets.py index 52bbf67e8ac..042087b8098 100644 --- a/mne/datasets/tests/test_datasets.py +++ b/mne/datasets/tests/test_datasets.py @@ -2,7 +2,6 @@ # License: BSD-3-Clause # Copyright the MNE-Python contributors. -import os import re import shutil import zipfile @@ -89,9 +88,6 @@ def noop(*args, **kwargs): monkeypatch.setattr(mne.datasets._fsaverage.base, "_manifest_check_download", noop) sd_2 = datasets.fetch_fsaverage() assert sd / "fsaverage" == sd_2 - with pytest.warns(FutureWarning, match="switch to using forward slash"): - sd_label_str = sd_2 + f"{os.sep}label" - assert sd_label_str == str(sd_2 / "label") @requires_good_network diff --git a/mne/export/_edf.py b/mne/export/_edf.py index 9ee838a9469..424d5250356 100644 --- a/mne/export/_edf.py +++ b/mne/export/_edf.py @@ -3,7 +3,7 @@ # Copyright the MNE-Python contributors. import datetime as dt -from typing import Callable +from collections.abc import Callable import numpy as np diff --git a/mne/fixes.py b/mne/fixes.py index c48f677106a..18f4536d72b 100644 --- a/mne/fixes.py +++ b/mne/fixes.py @@ -776,7 +776,7 @@ def _crop_colorbar(cbar, cbar_vmin, cbar_vmax): try: import numba - if _compare_version(numba.__version__, "<", "0.53.1"): + if _compare_version(numba.__version__, "<", "0.56.4"): raise ImportError prange = numba.prange diff --git a/mne/io/egi/egi.py b/mne/io/egi/egi.py index 2a9c312f112..433758e19bf 100644 --- a/mne/io/egi/egi.py +++ b/mne/io/egi/egi.py @@ -11,7 +11,7 @@ from ..._fiff.meas_info import _empty_info from ..._fiff.utils import _create_chs, _read_segments_file from ...annotations import Annotations -from ...utils import _check_fname, _validate_type, logger, verbose, warn +from ...utils import _check_fname, _validate_type, logger, verbose from ..base import BaseRaw from .egimff import _read_raw_egi_mff from .events import _combine_triggers, _triage_include_exclude @@ -100,7 +100,7 @@ def read_raw_egi( preload=False, channel_naming="E%d", *, - events_as_annotations=None, + events_as_annotations=True, verbose=None, ) -> "RawEGI": """Read EGI simple binary as raw object. @@ -169,13 +169,7 @@ def read_raw_egi( """ _validate_type(input_fname, "path-like", "input_fname") input_fname = str(input_fname) - if events_as_annotations is None: - warn( - "events_as_annotations defaults to False in 1.8 but will change to " - "True in 1.9, set it explicitly to avoid this warning", - FutureWarning, - ) - events_as_annotations = False + _validate_type(events_as_annotations, bool, "events_as_annotations") if input_fname.rstrip("/\\").endswith(".mff"): # allows .mff or .mff/ return _read_raw_egi_mff( diff --git a/mne/io/egi/egimff.py b/mne/io/egi/egimff.py index 3c905fd2965..d38d99322ac 100644 --- a/mne/io/egi/egimff.py +++ b/mne/io/egi/egimff.py @@ -354,7 +354,7 @@ def _read_raw_egi_mff( preload=False, channel_naming="E%d", *, - events_as_annotations=False, + events_as_annotations=True, verbose=None, ): """Read EGI mff binary as raw object.""" diff --git a/mne/io/egi/tests/test_egi.py b/mne/io/egi/tests/test_egi.py index babc9004b2c..d91b4fbd264 100644 --- a/mne/io/egi/tests/test_egi.py +++ b/mne/io/egi/tests/test_egi.py @@ -75,7 +75,7 @@ def test_egi_mff_pause(fname, skip_times, event_times): pytest.importorskip("defusedxml") if fname == egi_pause_w1337_fname: # too slow to _test_raw_reader - raw = read_raw_egi(fname).load_data() + raw = read_raw_egi(fname, events_as_annotations=False).load_data() else: with pytest.warns(RuntimeWarning, match="Acquisition skips detected"): raw = _test_raw_reader( @@ -83,6 +83,7 @@ def test_egi_mff_pause(fname, skip_times, event_times): input_fname=fname, test_scaling=False, # XXX probably some bug test_rank="less", + events_as_annotations=False, ) assert raw.info["sfreq"] == 250.0 # true for all of these files assert len(raw.annotations) == len(skip_times) @@ -252,6 +253,7 @@ def test_io_egi(): include=include, test_rank="less", test_scaling=False, # XXX probably some bug + events_as_annotations=False, ) assert "eeg" in raw diff --git a/mne/time_frequency/tfr.py b/mne/time_frequency/tfr.py index cf74b00cec2..64dffb4e94b 100644 --- a/mne/time_frequency/tfr.py +++ b/mne/time_frequency/tfr.py @@ -1870,8 +1870,6 @@ def plot( combine=None, layout=None, # TODO deprecate? not used in orig implementation either yscale="auto", - vmin=None, - vmax=None, vlim=(None, None), cnorm=None, cmap=None, @@ -1906,7 +1904,6 @@ def plot( %(yscale_tfr_plot)s .. versionadded:: 0.14.0 - %(vmin_vmax_tfr_plot)s %(vlim_tfr_plot)s %(cnorm)s @@ -1935,8 +1932,6 @@ def plot( figs : list of instances of matplotlib.figure.Figure A list of figures containing the time-frequency power. """ - # deprecations - vlim = _warn_deprecated_vmin_vmax(vlim, vmin, vmax) # the rectangle selector plots topomaps, which needs all channels uncombined, # so we keep a reference to that state here, and (because the topomap plotting # function wants an AverageTFR) update it with `comment` and `nave` values in @@ -2123,8 +2118,6 @@ def plot_joint( mode="mean", dB=False, yscale="auto", - vmin=None, - vmax=None, vlim=(None, None), cnorm=None, cmap=None, @@ -2155,7 +2148,6 @@ def plot_joint( %(mode_tfr_plot)s %(dB_tfr_plot_topo)s %(yscale_tfr_plot)s - %(vmin_vmax_tfr_plot)s %(vlim_tfr_plot_joint)s %(cnorm)s %(cmap_tfr_plot_topo)s @@ -2180,8 +2172,6 @@ def plot_joint( from matplotlib import ticker from matplotlib.patches import ConnectionPatch - # deprecations - vlim = _warn_deprecated_vmin_vmax(vlim, vmin, vmax) # handle recursion picks = _picks_to_idx( self.info, picks, "data_or_ica", exclude=exclude, with_ref_meg=False @@ -2717,37 +2707,12 @@ class AverageTFR(BaseTFR): Parameters ---------- - %(info_not_none)s - - .. deprecated:: 1.7 - Pass an instance of :class:`~mne.Epochs` or :class:`~mne.Evoked` instead, or - use :class:`~mne.time_frequency.AverageTFRArray` which retains the old API. - data : ndarray, shape (n_channels, n_freqs, n_times) - The data. - - .. deprecated:: 1.7 - Pass an instance of :class:`~mne.Epochs` or :class:`~mne.Evoked` instead, or - use :class:`~mne.time_frequency.AverageTFRArray` which retains the old API. - times : ndarray, shape (n_times,) - The time values in seconds. - - .. deprecated:: 1.7 - Pass an instance of :class:`~mne.Epochs` or :class:`~mne.Evoked` instead and - (optionally) use ``tmin`` and ``tmax`` to restrict the time domain; or use - :class:`~mne.time_frequency.AverageTFRArray` which retains the old API. - freqs : ndarray, shape (n_freqs,) - The frequencies in Hz. - nave : int - The number of averaged TFRs. - - .. deprecated:: 1.7 - Pass an instance of :class:`~mne.Epochs` or :class:`~mne.Evoked` instead; - ``nave`` will be inferred automatically. Or, use - :class:`~mne.time_frequency.AverageTFRArray` which retains the old API. inst : instance of Evoked | instance of Epochs | dict The data from which to compute the time-frequency representation. Passing a :class:`dict` will create the AverageTFR using the ``__setstate__`` interface and is not recommended for typical use cases. + freqs : ndarray, shape (n_freqs,) + The frequencies in Hz. %(method_tfr)s %(freqs_tfr)s %(tmin_tmax_psd)s @@ -2805,13 +2770,9 @@ class AverageTFR(BaseTFR): def __init__( self, - info=None, - data=None, - times=None, - freqs=None, - nave=None, *, inst=None, + freqs=None, method=None, tmin=None, tmax=None, @@ -2976,33 +2937,10 @@ class EpochsTFR(BaseTFR, GetEpochsMixin): Parameters ---------- - %(info_not_none)s - - .. deprecated:: 1.7 - Pass an instance of :class:`~mne.Epochs` as ``inst`` instead, or use - :class:`~mne.time_frequency.EpochsTFRArray` which retains the old API. - data : ndarray, shape (n_channels, n_freqs, n_times) - The data. - - .. deprecated:: 1.7 - Pass an instance of :class:`~mne.Epochs` as ``inst`` instead, or use - :class:`~mne.time_frequency.EpochsTFRArray` which retains the old API. - times : ndarray, shape (n_times,) - The time values in seconds. - - .. deprecated:: 1.7 - Pass an instance of :class:`~mne.Epochs` as ``inst`` instead and - (optionally) use ``tmin`` and ``tmax`` to restrict the time domain; or use - :class:`~mne.time_frequency.EpochsTFRArray` which retains the old API. - %(freqs_tfr_epochs)s inst : instance of Epochs The data from which to compute the time-frequency representation. + %(freqs_tfr_epochs)s %(method_tfr_epochs)s - %(comment_tfr_attr)s - - .. deprecated:: 1.7 - Pass an instance of :class:`~mne.Epochs` as ``inst`` instead, or use - :class:`~mne.time_frequency.EpochsTFRArray` which retains the old API. %(tmin_tmax_psd)s %(picks_good_data_noref)s %(proj_psd)s @@ -3083,14 +3021,10 @@ class EpochsTFR(BaseTFR, GetEpochsMixin): def __init__( self, - info=None, - data=None, - times=None, - freqs=None, *, inst=None, + freqs=None, method=None, - comment=None, tmin=None, tmax=None, picks=None, @@ -3107,44 +3041,6 @@ def __init__( ): from ..epochs import BaseEpochs - # deprecations. TODO remove after 1.7 release - depr_params = dict(info=info, data=data, times=times, comment=comment) - bad_params = list() - for name, param in depr_params.items(): - if param is not None: - bad_params.append(name) - if len(bad_params): - _s = _pl(bad_params) - is_are = _pl(bad_params, "is", "are") - bad_params_list = '", "'.join(bad_params) - warn( - f'Parameter{_s} "{bad_params_list}" {is_are} deprecated and will be ' - "removed in version 1.8. For a quick fix, use ``EpochsTFRArray`` with " - "the same parameters. For a long-term fix, see the docstring notes.", - FutureWarning, - ) - if inst is not None: - raise ValueError( - "Do not pass `inst` alongside deprecated params " - f'"{bad_params_list}"; see docstring of AverageTFR for guidance.' - ) - # sensible defaults are created in __setstate__ so only pass these through - # if they're user-specified - optional = dict( - freqs=freqs, - method=method, - events=events, - event_id=event_id, - selection=selection, - drop_log=drop_log, - metadata=metadata, - ) - optional_params = { - key: val for key, val in optional.items() if val is not None - } - inst = depr_params | optional_params - # end TODO ↑↑↑↑↑↑ - # dict is allowed for __setstate__ compatibility _validate_type( inst, (BaseEpochs, dict), "object passed to EpochsTFR constructor", "Epochs" @@ -3444,8 +3340,6 @@ def plot( combine=None, layout=None, # TODO deprecate; not used in orig implementation yscale="auto", - vmin=None, - vmax=None, vlim=(None, None), cnorm=None, cmap=None, @@ -3473,8 +3367,6 @@ def plot( combine=combine, layout=layout, yscale=yscale, - vmin=vmin, - vmax=vmax, vlim=vlim, cnorm=cnorm, cmap=cmap, @@ -3559,8 +3451,6 @@ def plot_joint( mode="mean", dB=False, yscale="auto", - vmin=None, - vmax=None, vlim=(None, None), cnorm=None, cmap=None, @@ -3585,8 +3475,6 @@ def plot_joint( mode=mode, dB=dB, yscale=yscale, - vmin=vmin, - vmax=vmax, vlim=vlim, cnorm=cnorm, cmap=cmap, @@ -4325,17 +4213,3 @@ def _prep_data_for_plot( if dB: data = 10 * np.log10(data) return data, times, freqs - - -def _warn_deprecated_vmin_vmax(vlim, vmin, vmax): - if vmin is not None or vmax is not None: - warning = "Parameters `vmin` and `vmax` are deprecated, use `vlim` instead." - if vlim[0] is None and vlim[1] is None: - vlim = (vmin, vmax) - else: - warning += ( - " You've also provided a (non-default) value for `vlim`, " - "so `vmin` and `vmax` will be ignored." - ) - warn(warning, FutureWarning) - return vlim diff --git a/mne/utils/_logging.py b/mne/utils/_logging.py index 58d0c627361..ee30a1812d8 100644 --- a/mne/utils/_logging.py +++ b/mne/utils/_logging.py @@ -12,8 +12,9 @@ import re import sys import warnings +from collections.abc import Callable from io import StringIO -from typing import Any, Callable, TypeVar +from typing import Any, TypeVar from decorator import FunctionMaker diff --git a/mne/utils/docs.py b/mne/utils/docs.py index a95b59f4b43..0fa9288bec2 100644 --- a/mne/utils/docs.py +++ b/mne/utils/docs.py @@ -4921,14 +4921,6 @@ def _reflow_param_docstring(docstring, has_first_line=True, width=75): ``min(data)`` or ``max(data)``, respectively.{extra} """ -docdict["vmin_vmax_tfr_plot"] = """ -vmin, vmax : float | None - Lower and upper bounds of the colormap. See ``vlim``. - - .. deprecated:: 1.7 - ``vmin`` and ``vmax`` will be removed in version 1.8. - Use ``vlim`` parameter instead. -""" # ↓↓↓ this one still used, needs helper func refactor before we can migrate to `vlim` docdict["vmin_vmax_tfr_plot_topo"] = _vmin_vmax_template.format( allowed="", bounds=_bounds_symmetric, extra="" diff --git a/mne/viz/_brain/_brain.py b/mne/viz/_brain/_brain.py index 13f1443be2f..1f06c62d66d 100644 --- a/mne/viz/_brain/_brain.py +++ b/mne/viz/_brain/_brain.py @@ -157,8 +157,6 @@ class Brain: .. versionchanged:: 0.23 Default changed to "auto". - offscreen : bool - Deprecated and will be removed in 1.9, do not use. interaction : str Can be "trackball" (default) or "terrain", i.e. a turntable-style camera. @@ -173,9 +171,6 @@ class Brain: %(theme_3d)s show : bool Display the window as soon as it is ready. Defaults to True. - block : bool - Deprecated and will be removed in 1.9, do not use. Consider using - :func:`matplotlib.pyplot.show` with ``block=True`` instead. Attributes ---------- @@ -292,25 +287,17 @@ def __init__( views="auto", *, offset="auto", - offscreen=None, interaction="trackball", units="mm", view_layout="vertical", silhouette=False, theme=None, show=True, - block=None, ): from ..backends.renderer import _get_renderer, backend _validate_type(subject, str, "subject") self._surf = surf - if offscreen is not None: - warn( - "The 'offscreen' parameter is deprecated and will be removed in 1.9. " - "as it has no effect", - FutureWarning, - ) if hemi is None: hemi = "vol" hemi = self._check_hemi(hemi, extras=("both", "split", "vol")) @@ -352,15 +339,9 @@ def __init__( subjects_dir = get_subjects_dir(subjects_dir) if subjects_dir is not None: subjects_dir = str(subjects_dir) - if block is not None: - warn( - "block is deprecated and will be removed in 1.9, use " - "plt.show(block=True) instead" - ) self.time_viewer = False self._hash = time.time_ns() - self._block = block self._hemi = hemi self._units = units self._alpha = float(alpha) @@ -529,8 +510,6 @@ def setup_time_viewer(self, time_viewer=True, show_traces=True): 'Left': Decrease camera azimuth angle 'Right': Increase camera azimuth angle """ - from ..backends._utils import _qt_app_exec - if self.time_viewer: return if not self._data: @@ -618,8 +597,6 @@ def setup_time_viewer(self, time_viewer=True, show_traces=True): # finally, show the MplCanvas if self.show_traces: self.mpl_canvas.show() - if self._block: - _qt_app_exec(self._renderer.figure.store["app"]) @safe_event def _clean(self): @@ -3067,11 +3044,7 @@ def close(self): def show(self): """Display the window.""" - from ..backends._utils import _qt_app_exec - self._renderer.show() - if self._block: - _qt_app_exec(self._renderer.figure.store["app"]) @fill_doc def get_view(self, row=0, col=0, *, align=True): diff --git a/pyproject.toml b/pyproject.toml index 420987f8fcb..c26107d20f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ authors = [ maintainers = [{ name = "Dan McCloy", email = "dan@mccloy.info" }] license = { text = "BSD-3-Clause" } readme = { file = "README.rst", content-type = "text/x-rst" } -requires-python = ">=3.9" +requires-python = ">=3.10" keywords = [ "neuroscience", "neuroimaging", @@ -223,6 +223,7 @@ ignore = [ "D100", # Missing docstring in public module "D104", # Missing docstring in public package "D413", # Missing blank line after last section + "UP038", # Lots of changes, run separately ] [tool.ruff.lint.pydocstyle] diff --git a/tools/environment_old.yml b/tools/environment_old.yml index 852d87844b3..4515f9cd611 100644 --- a/tools/environment_old.yml +++ b/tools/environment_old.yml @@ -2,12 +2,12 @@ name: mne channels: - conda-forge dependencies: - - python=3.9 - - numpy=1.23 - - scipy=1.9 + - python=3.10 + - numpy=1.24 + - scipy=1.10 - matplotlib=3.6 - - pandas=1.3.2 - - scikit-learn=1.1 + - pandas=1.5.2 + - scikit-learn=1.2 - nibabel # whichever one works - tqdm - pooch