From 8d79a62c04be053cf95817a8fb517afbe254dcde Mon Sep 17 00:00:00 2001 From: Iskander Gaba Date: Wed, 9 Oct 2024 19:44:16 +0200 Subject: [PATCH] Clean tools code --- pyriodicity/tools/__init__.py | 2 -- pyriodicity/tools/_tools.py | 13 +------------ 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/pyriodicity/tools/__init__.py b/pyriodicity/tools/__init__.py index 85ba005..c2877f6 100644 --- a/pyriodicity/tools/__init__.py +++ b/pyriodicity/tools/__init__.py @@ -1,7 +1,6 @@ from ._tools import ( acf, apply_window, - detrend, power_threshold, remove_overloaded_kwargs, seasonality_strength, @@ -11,7 +10,6 @@ __all__ = [ "acf", "apply_window", - "detrend", "power_threshold", "remove_overloaded_kwargs", "seasonality_strength", diff --git a/pyriodicity/tools/_tools.py b/pyriodicity/tools/_tools.py index c9de60f..0977bc5 100644 --- a/pyriodicity/tools/_tools.py +++ b/pyriodicity/tools/_tools.py @@ -1,8 +1,7 @@ -from typing import Callable, Dict, List, Optional, Union +from typing import Dict, List, Optional, Union import numpy as np from numpy.typing import ArrayLike, NDArray -from scipy.signal import detrend as _detrend from scipy.signal import get_window, periodogram from scipy.stats import kendalltau, pearsonr, spearmanr @@ -32,16 +31,6 @@ def apply_window(x: ArrayLike, window_func: Union[str, float, tuple]) -> NDArray return x * get_window(window=window_func, Nx=len(x)) -@staticmethod -def detrend( - x: ArrayLike, - method: Union[str, Callable[[ArrayLike], NDArray]], -) -> NDArray: - if isinstance(method, str): - return _detrend(x, type=method) - return method(x) - - @staticmethod def acf( x: ArrayLike,