DataDog/piecewise

IndexError: index out of range

Opened this issue · 1 comments

When trying to make this work with the given example, I get:
next_merge = heapq.heappop(merges)
IndexError: index out of range
Am I doing something wrong?
Thanks!

Hi @roussetjc - I'm trying to reproduce your error but haven't been able to. I tried running the example in the readme with a clean installation of this repo with both Python 3.7.3 and Python 2.7.16. I get the expected results. To make sure I understand, you are running the following code?

import numpy as np

t = np.arange(10)
v = np.array(
    [2*i for i in range(5)] +
    [10-i for i in range(5, 10)]
) + np.random.normal(0, 1, 10)

from piecewise import piecewise

model = piecewise(t, v)
print(model)