Skip to content

Commit

Permalink
Fix import nesting test
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrnr committed Feb 26, 2025
1 parent af1ddcd commit 2c90634
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 60 deletions.
4 changes: 4 additions & 0 deletions mne/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,15 +447,19 @@
"coreg",
"cuda",
"datasets",
"decoding",
"defaults",
"dipole",
"epochs",
"event",
"forward",
"io",
"filter",
"gui",
"inverse_sparse",
"minimum_norm",
"preprocessing",
"report",
"simulation",
"source_space",
"stats",
Expand Down
25 changes: 0 additions & 25 deletions mne/datasets/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,6 @@
# License: BSD-3-Clause
# Copyright the MNE-Python contributors.

from . import fieldtrip_cmc
from . import brainstorm
from . import visual_92_categories
from . import kiloword
from . import eegbci
from . import hf_sef
from . import misc
from . import mtrf
from . import sample
from . import somato
from . import multimodal
from . import fnirs_motor
from . import opm
from . import spm_face
from . import testing
from . import _fake
from . import phantom_4dbti
from . import sleep_physionet
from . import limo
from . import refmeg_noise
from . import ssvep
from . import erp_core
from . import epilepsy_ecog
from . import eyelink
from . import ucl_opm_auditory
from ._fetch import fetch_dataset
from .utils import (
_download_all_example_data,
Expand Down
1 change: 0 additions & 1 deletion mne/forward/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,3 @@
_as_meg_type_inst,
_map_meg_or_eeg_channels,
)
from . import _lead_dots # for testing purposes
29 changes: 2 additions & 27 deletions mne/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,7 @@
import sys as _sys

from .base import BaseRaw, concatenate_raws, match_channel_orders

from . import array
from . import base
from . import brainvision
from . import bti
from . import cnt
from . import ctf
from . import edf
from . import egi
from . import fiff
from . import fil
from . import kit
from . import nicolet
from . import nirx
from . import boxy
from . import persyst
from . import eeglab
from . import neuralynx
from . import nihon
from . import nsx
from ..utils import warn

from .ant import read_raw_ant
from .array import RawArray
Expand Down Expand Up @@ -68,17 +49,13 @@
_empty_info,
Info as _info,
)
from .._fiff.meas_info import Info
from .._fiff.open import show_fiff
from .._fiff.pick import get_channel_type_constants # moved up a level

from . import constants
from . import pick


def __getattr__(name):
"""Try getting attribute from fiff submodule."""
from ..utils import warn

if name in ("meas_info", "proj", "reference"):
warn(f"mne.io.{name} {_dep_msg}", FutureWarning)
return importlib.import_module(f"mne.io.{name}")
Expand All @@ -100,8 +77,6 @@ def __getattr__(name):
)
return Raw
elif name == "Info":
from .._fiff.meas_info import Info

warn(
"mne.io.Info is deprecated and will be removed in 1.6, "
"use mne.Info instead",
Expand Down
5 changes: 2 additions & 3 deletions mne/preprocessing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from .realign import realign_raw
# from .xdawn import Xdawn
from ._csd import compute_current_source_density, compute_bridged_electrodes
from . import nirs

from .artifact_detection import (
annotate_movement,
compute_average_dev_head_t,
Expand All @@ -45,9 +45,8 @@
)
from ._annotate_nan import annotate_nan
from .interpolate import equalize_bads, interpolate_bridged_electrodes
from . import ieeg

from ._css import cortical_signal_suppression
from .hfc import compute_proj_hfc
from ._lof import find_bad_channels_lof
from ._pca_obs import apply_pca_obs
from . import eyetracking
1 change: 0 additions & 1 deletion mne/simulation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
from .raw import simulate_raw, add_ecg, add_eog, add_chpi
from .source import select_source_in_label, simulate_stc, simulate_sparse_stc
from .source import SourceSimulator
from . import metrics
4 changes: 2 additions & 2 deletions mne/viz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@
close_all_3d_figures,
get_brain_class,
)
from . import backends, _scraper

from ._brain import Brain
from ._figure import get_browser_backend, set_browser_backend, use_browser_backend
from ._proj import plot_projs_joint
from . import ui_events

from .evoked_field import EvokedField
3 changes: 2 additions & 1 deletion mne/viz/_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import numpy as np

from .._fiff.pick import _DATA_CH_TYPES_SPLIT
from ..annotations import _sync_onset
from ..defaults import _handle_default
from ..filter import _iir_filter, _overlap_add_filter
from ..fixes import _compare_version
Expand Down Expand Up @@ -186,6 +185,8 @@ def _setup_annotation_colors(self):

def _update_annotation_segments(self):
"""Update the array of annotation start/end times."""
from ..annotations import _sync_onset

self.mne.annotation_segments = np.array([])
if len(self.mne.inst.annotations):
annot_start = _sync_onset(self.mne.inst, self.mne.inst.annotations.onset)
Expand Down

0 comments on commit 2c90634

Please sign in to comment.