From d2930f9f38727d878109475187c7bd305245514a Mon Sep 17 00:00:00 2001 From: Ryan Harvey Date: Wed, 16 Oct 2024 17:08:42 -0400 Subject: [PATCH] bugfix, modules io,lfp. tuple to Tuple --- neuro_py/io/loading.py | 2 +- neuro_py/lfp/preprocessing.py | 5 +++-- neuro_py/lfp/spectral.py | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/neuro_py/io/loading.py b/neuro_py/io/loading.py index 4edd797..55f70fb 100644 --- a/neuro_py/io/loading.py +++ b/neuro_py/io/loading.py @@ -2240,7 +2240,7 @@ def load_probe_layout(basepath: str) -> pd.DataFrame: return probe_layout -def load_emg(basepath: str, threshold: float = 0.9) -> tuple[nel.AnalogSignalArray, nel.EpochArray, nel.EpochArray]: +def load_emg(basepath: str, threshold: float = 0.9) -> Tuple[nel.AnalogSignalArray, nel.EpochArray, nel.EpochArray]: """ Load EMG data from basename.EMGFromLFP.LFP.mat. diff --git a/neuro_py/lfp/preprocessing.py b/neuro_py/lfp/preprocessing.py index 83f021f..0ffa836 100644 --- a/neuro_py/lfp/preprocessing.py +++ b/neuro_py/lfp/preprocessing.py @@ -1,3 +1,4 @@ +from typing import Tuple import nelpy as nel import numpy as np @@ -6,8 +7,8 @@ def clean_lfp( lfp: nel.AnalogSignalArray, - thresholds: tuple[float, float] = (5, 10), - artifact_time_expand: tuple[float, float] = (0.25, 0.1), + thresholds: Tuple[float, float] = (5, 10), + artifact_time_expand: Tuple[float, float] = (0.25, 0.1), ) -> np.ndarray: """ Remove artefacts and noise from a local field potential (LFP) signal. diff --git a/neuro_py/lfp/spectral.py b/neuro_py/lfp/spectral.py index ac1da15..3b827d1 100644 --- a/neuro_py/lfp/spectral.py +++ b/neuro_py/lfp/spectral.py @@ -1,4 +1,5 @@ from concurrent.futures import ThreadPoolExecutor +from typing import Tuple import numpy as np import pandas as pd @@ -47,7 +48,7 @@ def event_triggered_wavelet( parallel: bool = True, whiten: bool = True, whiten_order: int = 2, -) -> tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray] | tuple[pd.DataFrame, pd.Series]: +) -> Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray] | Tuple[pd.DataFrame, pd.Series]: """ Compute the event-triggered wavelet transform of a signal.