peakutils.indexes hangs when supplied with a constant array.

Issue #21 closed
Garvin Haslett created an issue

The following hangs an ipython shell:

peakutils.indexes(np.array([0.1]*100), thres=0.0, min_dist=10)

I would an empty array to be returned.

Comments (4)

  1. Garvin Haslett reporter

    Tested in a python2 interpreter:

    Python 2.7.12 (default, Nov 20 2017, 18:23:56) 
    [GCC 5.4.0 20160609] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import peakutils
    >>> import numpy as np
    >>> peakutils.indexes(np.array([0.1]*100), thres=0.0, min_dist=10)
    >>> peakutils.__version__
    '1.1.0'
    >>> scipy.__version__
    '1.0.0'
    >>> np.__version__
    '1.13.3'
    

    Hangs until I issue a keyboard interrupt.

    Also, at the end of original report, it should read: "I would expect an empty array to be returned."

    Let me know if there is anything else I can do.

  2. Lucas Hermann Negri repo owner

    Can you test with the latest git version? Maybe I forgot to release the fix in the cheese store.

  3. Log in to comment