Closed ytian closed 2 years ago
the code has some bugs for some test cases: code:
a = np.array([1, 1.2, 1.5, 1.8, 2.4, 3.3, 2.4, 1.5, 1.6]) peak_valley_pivots(a, 0.2, -0.2)
array([-1, 0, 0, 0, 0, 1, 0, 0, 1])
array([-1, 0, 0, 0, 0, 1, 0, -1, 1])
0.3.0 now has a hidden option for this.
0.3.0
See the issue_13.ipynb file in the repo.
issue_13.ipynb
I'll figure out a better solution to make it more explicit though.
the code has some bugs for some test cases: code:
a = np.array([1, 1.2, 1.5, 1.8, 2.4, 3.3, 2.4, 1.5, 1.6]) peak_valley_pivots(a, 0.2, -0.2)
output (wrong result)
array([-1, 0, 0, 0, 0, 1, 0, 0, 1])
output (after fix)
array([-1, 0, 0, 0, 0, 1, 0, -1, 1])