thebeat icon indicating copy to clipboard operation
thebeat copied to clipboard

fft_values makes rounding error?

Open Jellevanderwerff opened this issue 5 months ago • 1 comments

s = thebeat.Sequence([500, 502, 499, 500])
thebeat.stats.fft_plot(s, 1000)
plt.show()

returns:

Traceback (most recent call last):
  File "/Users/jellevanderwerff/thebeat/scratch.py", line 8, in <module>
    thebeat.stats.fft_plot(s, 1000)
  File "/Users/jellevanderwerff/thebeat/thebeat/stats.py", line 750, in fft_plot
    ax.plot(xf, yf)
  File "/Users/jellevanderwerff/thebeat/venv/lib/python3.9/site-packages/matplotlib/axes/_axes.py", line 1721, in plot
    lines = [*self._get_lines(self, *args, data=data, **kwargs)]
  File "/Users/jellevanderwerff/thebeat/venv/lib/python3.9/site-packages/matplotlib/axes/_base.py", line 303, in __call__
    yield from self._plot_args(
  File "/Users/jellevanderwerff/thebeat/venv/lib/python3.9/site-packages/matplotlib/axes/_base.py", line 499, in _plot_args
    raise ValueError(f"x and y must have same first dimension, but "
ValueError: x and y must have same first dimension, but have shapes (1001,) and (1002,)

This is only on the main branch, not on the stable branch, so has to do with 08f87a4 .

Jellevanderwerff avatar Jan 29 '24 17:01 Jellevanderwerff