Skip to content

Commit

Permalink
MAINT: Post-release deprecations, updates [circle deploy] (#11887)
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner authored Aug 15, 2023
1 parent 4dd4db9 commit 84da555
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 156 deletions.
12 changes: 6 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,17 @@ Dependencies
The minimum required dependencies to run MNE-Python are:

- Python >= 3.8
- NumPy >= 1.20.2
- SciPy >= 1.6.3
- Matplotlib >= 3.4.0
- NumPy >= 1.21.2
- SciPy >= 1.7.1
- Matplotlib >= 3.4.3
- pooch >= 1.5
- tqdm
- Jinja2
- decorator

For full functionality, some functions require:

- Scikit-learn >= 0.24.2
- Scikit-learn >= 1.0
- joblib >= 0.15 (for parallelization control)
- mne-qt-browser >= 0.1 (for fast raw data visualization)
- Qt5 >= 5.12 via one of the following bindings (for fast raw data visualization and interactive 3D visualization):
Expand All @@ -108,10 +108,10 @@ For full functionality, some functions require:
- PyQt5 >= 5.12
- PySide2 >= 5.12

- Numba >= 0.53.1
- Numba >= 0.54.0
- NiBabel >= 3.2.1
- OpenMEEG >= 2.5.6
- Pandas >= 1.2.4
- Pandas >= 1.3.2
- Picard >= 0.3
- CuPy >= 9.0.0 (for NVIDIA CUDA acceleration)
- DIPY >= 1.4.0
Expand Down
34 changes: 34 additions & 0 deletions doc/changes/latest.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. NOTE: we use cross-references to highlight new functions and classes.
Please follow the examples below like :func:`mne.stats.f_mway_rm`, so the
whats_new page will have a link to the function/class documentation.

.. NOTE: there are 3 separate sections for changes, based on type:
- "Enhancements" for new features
- "Bugs" for bug fixes
- "API changes" for backward-incompatible changes

.. NOTE: changes from first-time contributors should be added to the TOP of
the relevant section (Enhancements / Bugs / API changes), and should look
like this (where xxxx is the pull request number):

- description of enhancement/bugfix/API change (:gh:`xxxx` by
:newcontrib:`Firstname Lastname`)

Also add a corresponding entry for yourself in doc/changes/names.inc

.. _current:

Current (1.6.dev0)
------------------

Enhancements
~~~~~~~~~~~~
- None yet

Bugs
~~~~
- None yet

API changes
~~~~~~~~~~~
- None yet
2 changes: 1 addition & 1 deletion doc/changes/latest.inc.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

.. _current:

Current (1.1.dev0)
Current (X.Y.dev0)
------------------

Enhancements
Expand Down
12 changes: 6 additions & 6 deletions doc/install/installers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ 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.4.2/MNE-Python-1.4.2_0-Linux.sh
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.5.0/MNE-Python-1.5.0_0-Linux.sh
:ref-type: ref
:color: primary
:shadow:
Expand All @@ -31,14 +31,14 @@ Got any questions? Let us know on the `MNE Forum`_!

.. code-block:: console
$ sh ./MNE-Python-1.4.2_0-Linux.sh
$ sh ./MNE-Python-1.5.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.4.2/MNE-Python-1.4.2_0-macOS_Intel.pkg
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.5.0/MNE-Python-1.5.0_0-macOS_Intel.pkg
:ref-type: ref
:color: primary
:shadow:
Expand All @@ -54,7 +54,7 @@ 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.4.2/MNE-Python-1.4.2_0-macOS_M1.pkg
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.5.0/MNE-Python-1.5.0_0-macOS_M1.pkg
:ref-type: ref
:color: primary
:shadow:
Expand All @@ -70,7 +70,7 @@ 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.4.2/MNE-Python-1.4.2_0-Windows.exe
.. button-link:: https://github.com/mne-tools/mne-installers/releases/download/v1.5.0/MNE-Python-1.5.0_0-Windows.exe
:ref-type: ref
:color: primary
:shadow:
Expand Down Expand Up @@ -118,7 +118,7 @@ information, including a line that will read something like:

.. code-block::
Using Python: /some/directory/mne-python_1.4.2_0/bin/python
Using Python: /some/directory/mne-python_1.5.0_0/bin/python
This path is what you need to enter in VS Code when selecting the Python
interpreter.
Expand Down
1 change: 1 addition & 0 deletions doc/whats_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ What's new

.. currentmodule:: mne

.. include:: changes/latest.inc
.. include:: changes/1.5.inc
.. include:: changes/1.4.inc
.. include:: changes/1.3.inc
Expand Down
2 changes: 1 addition & 1 deletion mne/epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ def plot(
n_epochs=20,
n_channels=20,
title=None,
events=None,
events=False,
event_color=None,
order=None,
show=True,
Expand Down
54 changes: 12 additions & 42 deletions mne/io/eyelink/eyelink.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,20 @@
@fill_doc
def read_raw_eyelink(
fname,
preload=False,
verbose=None,
*,
create_annotations=True,
apply_offsets=False,
find_overlaps=False,
overlap_threshold=0.05,
gap_description=None,
preload=False,
verbose=None,
):
"""Reader for an Eyelink .asc file.
Parameters
----------
fname : path-like
Path to the eyelink file (.asc).
%(preload)s
%(verbose)s
create_annotations : bool | list (default True)
Whether to create mne.Annotations from occular events
(blinks, fixations, saccades) and experiment messages. If a list, must
Expand All @@ -100,16 +98,8 @@ def read_raw_eyelink(
the left and right eyes are separated by less than 50 ms, and the blink stop
times of the left and right eyes are separated by less than 50 ms, then the
blink will be merged into a single :class:`mne.Annotations`.
gap_description : str (default 'BAD_ACQ_SKIP')
Label for annotations that span across the gap period between the
blocks. Uses ``'BAD_ACQ_SKIP'`` by default so that these time periods will
be considered bad by MNE and excluded from operations like epoching.
.. deprecated:: 1.5
This parameter is deprecated and will be removed in version 1.6. Use
:meth:`mne.Annotations.rename` if you want something other than
``BAD_ACQ_SKIP`` as the annotation label.
%(preload)s
%(verbose)s
Returns
-------
Expand All @@ -132,13 +122,12 @@ def read_raw_eyelink(

raw_eyelink = RawEyelink(
fname,
preload=preload,
verbose=verbose,
create_annotations=create_annotations,
apply_offsets=apply_offsets,
find_overlaps=find_overlaps,
overlap_threshold=overlap_threshold,
gap_desc=gap_description,
preload=preload,
verbose=verbose,
)
return raw_eyelink

Expand Down Expand Up @@ -171,14 +160,6 @@ class RawEyelink(BaseRaw):
the :class:`mne.Annotations` will be kept separate (i.e. "blink_L",
"blink_R"). If the gap is smaller than the threshold, the
:class:`mne.Annotations` will be merged (i.e. "blink_both").
gap_desc : str
If there are multiple recording blocks in the file, the description of
the annotation that will span across the gap period between the
blocks. Default is ``None``, which uses 'BAD_ACQ_SKIP' by default so that these
timeperiods will be considered bad by MNE and excluded from operations like
epoching. Note that this parameter is deprecated and will be removed in 1.6.
Use ``mne.annotations.rename`` instead.
%(preload)s
%(verbose)s
Expand All @@ -197,13 +178,13 @@ class RawEyelink(BaseRaw):
def __init__(
self,
fname,
preload=False,
verbose=None,
*,
create_annotations=True,
apply_offsets=False,
find_overlaps=False,
overlap_threshold=0.05,
gap_desc=None,
preload=False,
verbose=None,
):
logger.info("Loading {}".format(fname))

Expand All @@ -214,16 +195,6 @@ def __init__(
self._meas_date = None
self._rec_info = None
self._ascii_sfreq = None
if gap_desc is None:
gap_desc = "BAD_ACQ_SKIP"
else:
warn(
"gap_description is deprecated in 1.5 and will be removed in 1.6, "
"use raw.annotations.rename to use a description other than "
"'BAD_ACQ_SKIP'",
FutureWarning,
)
self._gap_desc = gap_desc
self.dataframes = {}

# ======================== Parse ASCII File =========================
Expand All @@ -244,7 +215,7 @@ def __init__(
if n_blocks > 1:
logger.info(
f"There are {n_blocks} recording blocks in this file. Times between"
f" blocks will be annotated with {self._gap_desc}."
f" blocks will be annotated with BAD_ACQ_SKIP."
)
self.dataframes["samples"] = _adjust_times(
self.dataframes["samples"], self._ascii_sfreq
Expand Down Expand Up @@ -651,11 +622,10 @@ def _create_info(self, ch_names, sfreq):
def _make_gap_annots(self, key="recording_blocks"):
"""Create Annotations for gap periods between recording blocks."""
df = self.dataframes[key]
gap_desc = self._gap_desc
onsets = df["end_time"].iloc[:-1]
diffs = df["time"].shift(-1) - df["end_time"]
durations = diffs.iloc[:-1]
descriptions = [gap_desc] * len(onsets)
descriptions = ["BAD_ACQ_SKIP"] * len(onsets)
return Annotations(onset=onsets, duration=durations, description=descriptions)

def _make_eyelink_annots(self, df_dict, create_annots, apply_offsets):
Expand Down
10 changes: 0 additions & 10 deletions mne/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
_import_nibabel,
_import_pymatreader_funcs,
_check_head_radius,
has_nibabel,
)
from .config import (
set_config,
Expand Down Expand Up @@ -129,24 +128,16 @@
from .progressbar import ProgressBar
from ._testing import (
run_command_if_main,
requires_sklearn,
requires_version,
requires_mne,
requires_good_network,
requires_pandas,
requires_h5py,
ArgvSetter,
SilenceStdout,
has_freesurfer,
has_mne_c,
_TempDir,
buggy_mkl_svd,
requires_numpydoc,
requires_freesurfer,
requires_nitime,
requires_mne_mark,
requires_neuromag2ft,
requires_pylsl,
assert_object_equal,
assert_and_remove_boundary_annot,
_raw_annot,
Expand All @@ -156,7 +147,6 @@
assert_stcs_equal,
_click_ch_name,
requires_openmeeg_mark,
requires_mne_qt_browser,
)
from .numerics import (
hashfunc,
Expand Down
45 changes: 0 additions & 45 deletions mne/utils/_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,51 +125,6 @@ def requires_freesurfer(arg):
)


# %%
# Deprecated
def requires_version(library, min_version="0.0"):
"""Check for a library version."""
warn(
f"requires_version({repr(library)}, min_version={repr(min_version)}) "
"is deprecated and will be removed in 1.6, use pytest.importorskip("
f"{repr(library)}, minversion={repr(min_version)}) instead",
FutureWarning,
)
import pytest

reason = f"Requires {library}"
if min_version != "0.0":
reason += f" version >= {min_version}"
return pytest.mark.skipif(not check_version(library, min_version), reason=reason)


def requires_module(function, name, call=None):
"""Skip a test if package is not available (decorator)."""
msg = f"@requires_module({repr(name)}) is deprecated and will be removed " f"in 1.6"
if call is None:
msg += f" use pytest.importorskip({repr(name)}) instead"
else:
msg += f" use pytest.mark.skipif instead with the condition:\n\n{call}\n"
warn(msg, FutureWarning)
return _requires_module(function, name, call=call)


_n2ft_call = """
if 'NEUROMAG2FT_ROOT' not in os.environ:
raise ImportError
"""
requires_pandas = partial(requires_module, name="pandas")
requires_pylsl = partial(requires_module, name="pylsl")
requires_sklearn = partial(requires_module, name="sklearn")
requires_mne_qt_browser = partial(requires_module, name="mne_qt_browser")
requires_neuromag2ft = partial(requires_module, name="neuromag2ft", call=_n2ft_call)
requires_nitime = partial(requires_module, name="nitime")
requires_h5py = partial(requires_module, name="h5py")
requires_numpydoc = partial(requires_version, "numpydoc", "1.0")

# %% End deprecated


def run_command_if_main():
"""Run a given command if it's __main__."""
local_vars = inspect.currentframe().f_back.f_locals
Expand Down
7 changes: 0 additions & 7 deletions mne/utils/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import numpy as np

from ..fixes import _median_complex, _compare_version
from .docs import deprecated
from ._logging import warn, logger, verbose, _record_warnings, _verbose_safe_false


Expand Down Expand Up @@ -1203,12 +1202,6 @@ def _to_rgb(*args, name="color", alpha=False):
) from None


@deprecated("has_nibabel is deprecated and will be removed in 1.5")
def has_nibabel():
"""Check if nibabel is installed."""
return check_version("nibabel") # pragma: no cover


def _import_nibabel(why="use MRI files"):
try:
import nibabel as nib
Expand Down
Loading

0 comments on commit 84da555

Please sign in to comment.