Skip to content

Rarely reproducible error with fftconvolve for expected_cis #362

@agalitsyna

Description

@agalitsyna

clever solution that immensely speeds up the expected_cis calculation is to do fast Fourier convolution for calculation of pairwise distances between bad bins (here). However, at least with latest scipy version 1.8.1, there is a rarely encountered problem that fftconvolve produces NaNs for all of the output (it is not stochastic, but happens for some shapes of bad bins vectors). Because we explicitly convert nans to integers, they become negative very large numbers. (noticed by @kannandeepti )
I do not know what might be a problem with fftconvolve, but maybe we can pass an option to calculate regular convolution?

E.g. this scipy.signal.convolve(x, x[::-1], mode="full", method="direct") will produce no error if used instead of:

return np.round(fftconvolve(x, x[::-1], mode="full")).astype(int)[-n:]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions