Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors management for .predict() method of ruptures.detection.Window class #12

Open
LGabilly opened this issue Aug 28, 2019 · 1 comment

Comments

@LGabilly
Copy link

As I understand, the predict of the ruptures.detection.Window class will fail if the number of samples in the signal is lower than 1.5 x the width parameters of the __init__ method.

Python will raise the following error

~/Documents/env/lib/python3.6/site-packages/ruptures/detection/window.py in _seg(self, n_bkps, pen, epsilon)
    177         peak_inds_arr = np.take(self.inds, peak_inds_shifted)
    178         # sort according to score value
--> 179         _, peak_inds = unzip(sorted(zip(gains, peak_inds_arr)))
    180         peak_inds = list(peak_inds)
    181 

ValueError: not enough values to unpack (expected 2, got 0)

which is a bit ambiguous.

Did I miss something in the documentation ? Or a slight improvement in error management is feasible ?

@idnavid
Copy link

idnavid commented Feb 4, 2020

This is definitely a bug. I get the same error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants