Repository: scipy/scipy
File: scipy/signal/windows/_windows.py (Python)

Code before:
    ('gaussian', 'gauss', 'gss'): (gaussian, True),
    ('general cosine', 'general_cosine'): (general_cosine, True),
    ('general gaussian', 'general_gaussian', 'general gauss',
     'general_gauss', 'ggs'): (general_gaussian, True),
    ('general hamming', 'general_hamming'): (general_hamming, True),
    ('hamming', 'hamm', 'ham'): (hamming, False),
    ('hann', 'han'): (hann, False),
    ('kaiser', 'ksr'): (kaiser, True),
    ('kaiser bessel derived', 'kaiser_bessel_derived',
     'kbd'): (kaiser_bessel_derived, True),
    ('lanczos', 'sinc'): (lanczos, False),
    ('nuttall', 'nutl', 'nut'): (nuttall, False),
    ('parzen', 'parz', 'par'): (parzen, False),
    ('taylor', 'taylorwin'): (taylor, 'OPTIONAL'),
    ('triangle', 'triang', 'tri'): (triang, False),
    ('tukey', 'tuk'): (tukey, 'OPTIONAL'), }
_WIN_FUNCS = dict()
for nn_, v_ in _WIN_FUNC_DATA.items():
    _WIN_FUNCS.update({n_: v_ for n_ in nn_})


def get_window(window, Nx, fftbins=True, *, xp=None, device=None):
    r"""Convenience function for creating various windows.

    This function is wrapper for the window functions provided in the
    `scipy.signal.windows` name.space.

    Parameters
    ----------
    window : str | tuple | float
        Either a string with the window name or a tuple consisting of window name and
        window parameters. If it is a float, a `~scipy.singal.kaiser` window is
        created with `window` being the shape parameter. Consult the Notes below for
        more details.
    Nx : int
        The number of samples in the window.
    fftbins : bool, optional
        If ``True`` (default), create a periodic window, ready to use with `ifftshift`
        and be multiplied by the result of an FFT (see also
        :func:`~scipy.fft.fftfreq`). If ``False``, create a symmetric window, for use
        in filter design. This parameter is ignored, if the window name in the
        `window` parameter has a suffix ``'_periodic'`` or ``'_symmetric'`` appended to
        it (e.g., ``'hann_symmetric'``).
    %(xp_device_snippet)s

    Returns
    -------
    get_window : ndarray
        Returns the created window as a one-dimensional array made of `Nx` samples.

    Raises

Review comment (suggestion):
```suggestion
    This function is a wrapper for the window functions provided in the
    `scipy.signal.windows` namespace.
```

Code after:
    ('gaussian', 'gauss', 'gss'): (gaussian, True),
    ('general cosine', 'general_cosine'): (general_cosine, True),
    ('general gaussian', 'general_gaussian', 'general gauss',
     'general_gauss', 'ggs'): (general_gaussian, True),
    ('general hamming', 'general_hamming'): (general_hamming, True),
    ('hamming', 'hamm', 'ham'): (hamming, False),
    ('hann', 'han'): (hann, False),
    ('kaiser', 'ksr'): (kaiser, True),
    ('kaiser bessel derived', 'kaiser_bessel_derived',
     'kbd'): (kaiser_bessel_derived, True),
    ('lanczos', 'sinc'): (lanczos, False),
    ('nuttall', 'nutl', 'nut'): (nuttall, False),
    ('parzen', 'parz', 'par'): (parzen, False),
    ('taylor', 'taylorwin'): (taylor, 'OPTIONAL'),
    ('triangle', 'triang', 'tri'): (triang, False),
    ('tukey', 'tuk'): (tukey, 'OPTIONAL'), }
_WIN_FUNCS = dict()
for nn_, v_ in _WIN_FUNC_DATA.items():
    _WIN_FUNCS.update({n_: v_ for n_ in nn_})


def get_window(window, Nx, fftbins=True, *, xp=None, device=None):
    r"""Convenience function for creating various windows.

    This function is a wrapper for the window functions provided in the
    `scipy.signal.windows` namespace.

    Parameters
    ----------
    window : str | tuple | float
        Either a string with the window name or a tuple consisting of window name and
        window parameters. If it is a float, a `~scipy.singal.kaiser` window is
        created with `window` being the shape parameter. Consult the Notes below for
        more details.
    Nx : int
        The number of samples in the window.
    fftbins : bool, optional
        If ``True`` (default), create a periodic window, ready to use with `ifftshift`
        and be multiplied by the result of an FFT (see also
        :func:`~scipy.fft.fftfreq`). If ``False``, create a symmetric window, for use
        in filter design. This parameter is ignored, if the window name in the
        `window` parameter has a suffix ``'_periodic'`` or ``'_symmetric'`` appended to
        it (e.g., ``'hann_symmetric'``).
    %(xp_device_snippet)s

    Returns
    -------
    get_window : ndarray
        Returns the created window as a one-dimensional array made of `Nx` samples.

    Raises