Skip to content

Commit

Permalink
MAINT: Post-release deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Dec 4, 2023
1 parent 4a1674c commit 3b9676b
Show file tree
Hide file tree
Showing 22 changed files with 13 additions and 445 deletions.
19 changes: 0 additions & 19 deletions mne/_fiff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,3 @@

# All imports should be done directly to submodules, so we don't import
# anything here or use lazy_loader.

# This warn import (made private as _warn) is just for the temporary
# _io_dep_getattr and can be removed in 1.6 along with _dep_msg and _io_dep_getattr.
from ..utils import warn as _warn


_dep_msg = (
"is deprecated will be removed in 1.6, use documented public API instead. "
"If no appropriate public API exists, please open an issue on GitHub."
)


def _io_dep_getattr(name, mod):
import importlib

fiff_mod = importlib.import_module(f"mne._fiff.{mod}")
obj = getattr(fiff_mod, name)
_warn(f"mne.io.{mod}.{name} {_dep_msg}", FutureWarning)
return obj
52 changes: 6 additions & 46 deletions mne/gui/_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,24 @@
# License: BSD-3-Clause
# Copyright the MNE-Python contributors.

from ..utils import get_config, verbose, warn
from ..utils import get_config, verbose


@verbose
def coregistration(
*,
tabbed=None,
split=None,
width=None,
height=None,
inst=None,
subject=None,
subjects_dir=None,
guess_mri_subject=None,
height=None,
head_opacity=None,
head_high_res=None,
trans=None,
scrollable=None,
orient_to_surface=None,
scale_by_distance=None,
mark_inside=None,
interaction=None,
scale=None,
advanced_rendering=None,
head_inside=None,
fullscreen=None,
show=True,
block=False,
Expand All @@ -45,29 +38,20 @@ def coregistration(
Parameters
----------
tabbed : bool
Combine the data source panel and the coregistration panel into a
single panel with tabs.
split : bool
Split the main panels with a movable splitter (good for QT4 but
unnecessary for wx backend).
width : int | None
Specify the width for window (in logical pixels).
Default is None, which uses ``MNE_COREG_WINDOW_WIDTH`` config value
(which defaults to 800).
height : int | None
Specify a height for window (in logical pixels).
Default is None, which uses ``MNE_COREG_WINDOW_WIDTH`` config value
(which defaults to 400).
inst : None | str
Path to an instance file containing the digitizer data. Compatible for
Raw, Epochs, and Evoked files.
subject : None | str
Name of the mri subject.
%(subjects_dir)s
guess_mri_subject : bool
When selecting a new head shape file, guess the subject's name based
on the filename and change the MRI subject accordingly (default True).
height : int | None
Specify a height for window (in logical pixels).
Default is None, which uses ``MNE_COREG_WINDOW_WIDTH`` config value
(which defaults to 400).
head_opacity : float | None
The opacity of the head surface in the range [0., 1.].
Default is None, which uses ``MNE_COREG_HEAD_OPACITY`` config value
Expand All @@ -78,8 +62,6 @@ def coregistration(
(which defaults to True).
trans : path-like | None
The transform file to use.
scrollable : bool
Make the coregistration panel vertically scrollable (default True).
orient_to_surface : bool | None
If True (default), orient EEG electrode and head shape points
to the head surface.
Expand Down Expand Up @@ -143,28 +125,6 @@ def coregistration(
.. youtube:: ALV5qqMHLlQ
"""
unsupported_params = {
"tabbed": tabbed,
"split": split,
"scrollable": scrollable,
"head_inside": head_inside,
"guess_mri_subject": guess_mri_subject,
"scale": scale,
"advanced_rendering": advanced_rendering,
}
for key, val in unsupported_params.items():
if isinstance(val, tuple):
to_raise = val[0] != val[1]
else:
to_raise = val is not None
if to_raise:
warn(
f"The parameter {key} is deprecated and will be removed in 1.7, do "
"not pass a value for it",
FutureWarning,
)
del tabbed, split, scrollable, head_inside, guess_mri_subject, scale
del advanced_rendering
config = get_config()
if head_high_res is None:
head_high_res = config.get("MNE_COREG_HEAD_HIGH_RES", "true") == "true"
Expand Down
9 changes: 0 additions & 9 deletions mne/io/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@
# License: BSD-3-Clause
# Copyright the MNE-Python contributors.

from .._fiff import _io_dep_getattr
from .._fiff.constants import FIFF

__all__ = ["FIFF"]


def __getattr__(name):
try:
return globals()[name]
except KeyError:
pass
return _io_dep_getattr(name, "constants")
11 changes: 0 additions & 11 deletions mne/io/meas_info.py

This file was deleted.

9 changes: 0 additions & 9 deletions mne/io/pick.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# Copyright the MNE-Python contributors.


from .._fiff import _io_dep_getattr
from .._fiff.pick import (
_DATA_CH_TYPES_ORDER_DEFAULT,
_DATA_CH_TYPES_SPLIT,
Expand All @@ -18,11 +17,3 @@
"_DATA_CH_TYPES_ORDER_DEFAULT",
"_DATA_CH_TYPES_SPLIT",
]


def __getattr__(name):
try:
return globals()[name]
except KeyError:
pass
return _io_dep_getattr(name, "pick")
11 changes: 0 additions & 11 deletions mne/io/proj.py

This file was deleted.

11 changes: 0 additions & 11 deletions mne/io/reference.py

This file was deleted.

11 changes: 0 additions & 11 deletions mne/io/tag.py

This file was deleted.

11 changes: 0 additions & 11 deletions mne/io/utils.py

This file was deleted.

11 changes: 0 additions & 11 deletions mne/io/write.py

This file was deleted.

2 changes: 0 additions & 2 deletions mne/preprocessing/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ __all__ = [
"annotate_movement",
"annotate_muscle_zscore",
"annotate_nan",
"apply_maxfilter",
"compute_average_dev_head_t",
"compute_bridged_electrodes",
"compute_current_source_density",
Expand Down Expand Up @@ -77,7 +76,6 @@ from .ica import (
)
from .infomax_ import infomax
from .interpolate import equalize_bads, interpolate_bridged_electrodes
from .maxfilter import apply_maxfilter
from .maxwell import (
compute_maxwell_basis,
find_bad_channels_maxwell,
Expand Down
Loading

0 comments on commit 3b9676b

Please sign in to comment.