djoffrey / HarmonicPatterns

A library written in Python to search harmonic patterns automatically.
MIT License
117 stars 64 forks source link

Division by zero warnings #9

Open cunhasdepedra opened 1 year ago

cunhasdepedra commented 1 year ago

@djoffrey Hey, I'm also getting this:

:823: RuntimeWarning: invalid value encountered in double_scalars XAD = abs(A-D) / abs(X-A) :946: RuntimeWarning: invalid value encountered in double_scalars XAD = abs(A-D) / abs(X-A) :1055: RuntimeWarning: invalid value encountered in double_scalars XAD = abs(A-D) / abs(X-A) :1177: RuntimeWarning: invalid value encountered in double_scalars XAD = abs(A-D) / abs(X-A) :123: RuntimeWarning: invalid value encountered in double_scalars XAD = abs(A-D) / abs(X-A) :1180: RuntimeWarning: invalid value encountered in double_scalars XCD = abs(D-C) / abs(X-C) From what I was able to check, it's not compromising my patterns validation. But I would like to hear from you too.
cunhasdepedra commented 1 year ago

Let me be more precise: those warnings compromise the calculations that lead to the patterns formation? So I might be getting wrong patterns?

djoffrey commented 1 year ago

I can't not 100% sure, but if the X-C near 0, the float part may be importance, but that wont fit in the patterns. if you need the ensure the accuracy, do some type convert to avoid this msg.