Skip to content

Commit 2e486fe

Browse files
committed
fix lint.
1 parent cf9793d commit 2e486fe

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/ptwt/packets.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from itertools import product
77
from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Tuple, Union, cast
88

9+
import numpy as np
910
import pywt
1011
import torch
11-
import numpy as np
1212

1313
from ._util import Wavelet, _as_wavelet
1414
from .conv_transform import wavedec, waverec
@@ -23,21 +23,22 @@
2323
BaseDict = collections.UserDict
2424

2525

26-
def _wpfreq(fs: float, level: int) -> np.ndarray:
27-
"""Compute the frequencies for a fully decomposed single dimensional
28-
packet tree. The packet transform linearly subdivides all frequencies
26+
def _wpfreq(fs: float, level: int) -> List[float]:
27+
"""Compute the frequencies for a fully decomposed 1d packet tree.
28+
29+
The packet transform linearly subdivides all frequencies
2930
from zero up to the Nyquist frequency.
3031
3132
Args:
32-
fs (float): The sampling frequency
33-
level (int): The decomposition level
33+
fs (float): The sampling frequency.
34+
level (int): The decomposition level.
3435
3536
Returns:
36-
np.ndarray: The frequency bins of the packets in frequency order.
37+
List[float]: The frequency bins of the packets in frequency order.
3738
"""
38-
n = list(range(int(np.power(2., level))))
39-
freqs = (fs/2.)*(n/(np.power(2., level)))
40-
return freqs
39+
n = np.array(range(int(np.power(2.0, level))))
40+
freqs = (fs / 2.0) * (n / (np.power(2.0, level)))
41+
return list(freqs)
4142

4243

4344
class WaveletPacket(BaseDict):

0 commit comments

Comments
 (0)