Skip to content

Commit

Permalink
Update stub files (#346)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] authored Oct 17, 2024
1 parent 59a221f commit 3b7d94a
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 23 deletions.
19 changes: 14 additions & 5 deletions mne_lsl/lsl/stream_info.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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'``.
Expand All @@ -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.
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions mne_lsl/lsl/stream_inlet.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion mne_lsl/lsl/stream_outlet.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion mne_lsl/player/_base.pyi
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion mne_lsl/player/player_lsl.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 8 additions & 8 deletions mne_lsl/stream/base.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion mne_lsl/stream/epochs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion mne_lsl/stream/stream_lsl.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from collections.abc import Sequence as Sequence
from collections.abc import Sequence

from _typeshed import Incomplete

Expand Down
4 changes: 2 additions & 2 deletions mne_lsl/utils/_imports.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from types import ModuleType as ModuleType
from types import ModuleType

_INSTALL_MAPPING: dict[str, str]

Expand All @@ -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.
"""
2 changes: 1 addition & 1 deletion mne_lsl/utils/_tests.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pathlib import Path as Path
from pathlib import Path

from mne import Info
from mne.io import BaseRaw
Expand Down

0 comments on commit 3b7d94a

Please sign in to comment.