Skip to content

Commit

Permalink
Clean tools code
Browse files Browse the repository at this point in the history
  • Loading branch information
iskandergaba committed Oct 9, 2024
1 parent cdd2a47 commit 8d79a62
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
2 changes: 0 additions & 2 deletions pyriodicity/tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from ._tools import (
acf,
apply_window,
detrend,
power_threshold,
remove_overloaded_kwargs,
seasonality_strength,
Expand All @@ -11,7 +10,6 @@
__all__ = [
"acf",
"apply_window",
"detrend",
"power_threshold",
"remove_overloaded_kwargs",
"seasonality_strength",
Expand Down
13 changes: 1 addition & 12 deletions pyriodicity/tools/_tools.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 8d79a62

Please sign in to comment.