Scipy released version 1.13.0 a few days ago (2024/04/03). The window functions can not be accessed directly in the scipy.signal module from this version, otherwise it would raise errors like the following:
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/biosppy/signals/ecg.py:1053: in hamilton_segmenter
dx, _ = st.smoother(signal=dx, kernel="hamming", size=sm_size, mirror=True)
/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/biosppy/signals/tools.py:606: in smoother
win = _get_window(kernel, size, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
kernel = 'hamming', size = 40, kwargs = {}
def _get_window(kernel, size, **kwargs):
"""Return a window with the specified parameters.
Parameters
----------
kernel : str
Type of window to create.
size : int
Size of the window.
``**kwargs`` : dict, optional
Additional keyword arguments are passed to the underlying
scipy.signal.windows function.
Returns
-------
window : array
Created window.
"""
# mimics scipy.signal.get_window
if kernel in ["blackman", "black", "blk"]:
winfunc = ss.blackman
elif kernel in ["triangle", "triang", "tri"]:
winfunc = ss.triang
elif kernel in ["hamming", "hamm", "ham"]:
> winfunc = ss.hamming
E AttributeError: module 'scipy.signal' has no attribute 'hamming'
In stead, one can access window functions through the scipy.signal.window module, or via the function scipy.signal.get_window.
Scipy released version 1.13.0 a few days ago (2024/04/03). The window functions can not be accessed directly in the scipy.signal module from this version, otherwise it would raise errors like the following:
In stead, one can access window functions through the
scipy.signal.window
module, or via the functionscipy.signal.get_window
.