diff --git a/mne_lsl/lsl/stream_info.pyi b/mne_lsl/lsl/stream_info.pyi index c2dfba18e..a87b80ebd 100644 --- a/mne_lsl/lsl/stream_info.pyi +++ b/mne_lsl/lsl/stream_info.pyi @@ -3,7 +3,7 @@ from typing import Any from _typeshed import Incomplete from mne import Info, Projection from mne.io._digitization import DigPoint -from numpy.typing import DTypeLike as DTypeLike +from numpy.typing import DTypeLike from .._typing import ScalarIntArray as ScalarIntArray from ..utils._checks import check_type as check_type @@ -279,7 +279,7 @@ class _BaseStreamInfo: :class:`~mne.Info` containing the measurement information. """ - def set_channel_names(self, ch_names: list[str] | tuple[str]) -> None: + def set_channel_names(self, ch_names: list[str] | tuple[str, ...]) -> None: """Set the channel names in the description. Existing labels are overwritten. Parameters @@ -288,7 +288,7 @@ class _BaseStreamInfo: List of channel names, matching the number of total channels. """ - def set_channel_types(self, ch_types: str | list[str]) -> None: + def set_channel_types(self, ch_types: str | list[str] | tuple[str, ...]) -> None: """Set the channel types in the description. Existing types are overwritten. The types are given as human readable strings, e.g. ``'eeg'``. @@ -301,7 +301,14 @@ class _BaseStreamInfo: """ def set_channel_units( - self, ch_units: str | list[str] | int | list[int] | ScalarIntArray + self, + ch_units: str + | list[str] + | int + | list[int] + | ScalarIntArray + | tuple[str, ...] + | tuple[int, ...], ) -> None: """Set the channel units in the description. Existing units are overwritten. @@ -323,7 +330,9 @@ class _BaseStreamInfo: ``FIFF_UNITM_NONE`` in MNE-Python. """ - def _set_channel_info(self, ch_infos: list[str], name: str) -> None: + def _set_channel_info( + self, ch_infos: list[str] | tuple[str, ...], name: str + ) -> None: """Set the 'channel/name' element in the XML tree.""" def _set_channel_projectors(self, projs: list[Projection]) -> None: diff --git a/mne_lsl/lsl/stream_inlet.pyi b/mne_lsl/lsl/stream_inlet.pyi index 7e02df567..fa535a418 100644 --- a/mne_lsl/lsl/stream_inlet.pyi +++ b/mne_lsl/lsl/stream_inlet.pyi @@ -1,8 +1,8 @@ -from collections.abc import Sequence as Sequence +from collections.abc import Sequence import numpy as np from _typeshed import Incomplete -from numpy.typing import DTypeLike as DTypeLike +from numpy.typing import DTypeLike from numpy.typing import NDArray as NDArray from .._typing import ScalarArray as ScalarArray diff --git a/mne_lsl/lsl/stream_outlet.pyi b/mne_lsl/lsl/stream_outlet.pyi index fa34fdf1e..38d17d389 100644 --- a/mne_lsl/lsl/stream_outlet.pyi +++ b/mne_lsl/lsl/stream_outlet.pyi @@ -1,5 +1,5 @@ from _typeshed import Incomplete -from numpy.typing import DTypeLike as DTypeLike +from numpy.typing import DTypeLike from .._typing import ScalarArray as ScalarArray from .._typing import ScalarFloatArray as ScalarFloatArray diff --git a/mne_lsl/player/_base.pyi b/mne_lsl/player/_base.pyi index 69a08c64c..af8905989 100644 --- a/mne_lsl/player/_base.pyi +++ b/mne_lsl/player/_base.pyi @@ -1,6 +1,6 @@ from abc import ABC, abstractmethod from collections.abc import Callable -from datetime import datetime as datetime +from datetime import datetime from pathlib import Path from typing import Any diff --git a/mne_lsl/player/player_lsl.pyi b/mne_lsl/player/player_lsl.pyi index b02c8f506..85a84e1a3 100644 --- a/mne_lsl/player/player_lsl.pyi +++ b/mne_lsl/player/player_lsl.pyi @@ -1,5 +1,5 @@ from collections.abc import Callable -from pathlib import Path as Path +from pathlib import Path from _typeshed import Incomplete from mne import Annotations diff --git a/mne_lsl/stream/base.pyi b/mne_lsl/stream/base.pyi index 81fb15dda..e0f877a28 100644 --- a/mne_lsl/stream/base.pyi +++ b/mne_lsl/stream/base.pyi @@ -1,15 +1,15 @@ from abc import ABC, abstractmethod from collections.abc import Callable, Generator -from datetime import datetime as datetime +from datetime import datetime from typing import Any import numpy as np from _typeshed import Incomplete from mne import Info -from mne.channels import DigMontage as DigMontage +from mne.channels import DigMontage from mne.channels.channels import SetChannelsMixin from mne.io.meas_info import ContainsMixin -from numpy.typing import DTypeLike as DTypeLike +from numpy.typing import DTypeLike from numpy.typing import NDArray as NDArray from .._typing import ScalarArray as ScalarArray @@ -92,7 +92,7 @@ class BaseStream(ABC, ContainsMixin, SetChannelsMixin): def add_reference_channels( self, - ref_channels: str | list[str] | tuple[str], + ref_channels: str | list[str] | tuple[str, ...], ref_units: str | int | list[str | int] | tuple[str | int, ...] | None = None, ) -> BaseStream: """Add EEG reference channels to data that consists of all zeros. @@ -378,7 +378,7 @@ class BaseStream(ABC, ContainsMixin, SetChannelsMixin): self, winsize: float | None = None, picks: str | list[str] | int | list[int] | ScalarIntArray | None = None, - exclude: str | list[str] | tuple[str] = "bads", + exclude: str | list[str] | tuple[str, ...] = "bads", ) -> tuple[ScalarArray, NDArray[np.float64]]: """Retrieve the latest data from the buffer. @@ -648,8 +648,8 @@ class BaseStream(ABC, ContainsMixin, SetChannelsMixin): def set_eeg_reference( self, - ref_channels: str | list[str] | tuple[str], - ch_type: str | list[str] | tuple[str] = "eeg", + ref_channels: str | list[str] | tuple[str, ...], + ch_type: str | list[str] | tuple[str, ...] = "eeg", ) -> BaseStream: """Specify which reference to use for EEG-like data. @@ -679,7 +679,7 @@ class BaseStream(ABC, ContainsMixin, SetChannelsMixin): """ def set_meas_date( - self, meas_date: datetime | float | tuple[float] | None + self, meas_date: datetime | float | tuple[float, float] | None ) -> BaseStream: """Set the measurement start date. diff --git a/mne_lsl/stream/epochs.pyi b/mne_lsl/stream/epochs.pyi index 9fa4f245e..c96d61f52 100644 --- a/mne_lsl/stream/epochs.pyi +++ b/mne_lsl/stream/epochs.pyi @@ -264,7 +264,7 @@ class EpochsStream: self, n_epochs: int | None = None, picks: str | list[str] | int | list[int] | ScalarIntArray | None = None, - exclude: str | list[str] | tuple[str] = "bads", + exclude: str | list[str] | tuple[str, ...] = "bads", ) -> ScalarArray: """Retrieve the latest epochs from the buffer. diff --git a/mne_lsl/stream/stream_lsl.pyi b/mne_lsl/stream/stream_lsl.pyi index dc37e4655..4498e8e08 100644 --- a/mne_lsl/stream/stream_lsl.pyi +++ b/mne_lsl/stream/stream_lsl.pyi @@ -1,4 +1,4 @@ -from collections.abc import Sequence as Sequence +from collections.abc import Sequence from _typeshed import Incomplete diff --git a/mne_lsl/utils/_imports.pyi b/mne_lsl/utils/_imports.pyi index ec6c4339b..4d2d65e67 100644 --- a/mne_lsl/utils/_imports.pyi +++ b/mne_lsl/utils/_imports.pyi @@ -1,4 +1,4 @@ -from types import ModuleType as ModuleType +from types import ModuleType _INSTALL_MAPPING: dict[str, str] @@ -23,7 +23,7 @@ def import_optional_dependency( Returns ------- - module : Optional[ModuleType] + module : Module | None The imported module when found. None is returned when the package is not found and raise_error is False. """ diff --git a/mne_lsl/utils/_tests.pyi b/mne_lsl/utils/_tests.pyi index aa5f5c754..844c9a70a 100644 --- a/mne_lsl/utils/_tests.pyi +++ b/mne_lsl/utils/_tests.pyi @@ -1,4 +1,4 @@ -from pathlib import Path as Path +from pathlib import Path from mne import Info from mne.io import BaseRaw