Open zxweed opened 3 months ago
To fix this issue, you can convert the array to a contiguous array using np.ascontiguousarray function, like this:
y_contiguous = np.ascontiguousarray(y[0]) fig.add_trace(go.Scattergl(name='noisy sine', showlegend=True), hf_x=x, hf_y=y_contiguous) Alternatively, you can create the original array with a contiguous memory layout by removing the order='F' parameter: y = np.zeros(shape=(2, k))
of course I can (and I do), but it would be better if it was done automatically inside plotly_resampler (or better, process by strides - conversion will require double memory consumption)
@jvdd, I think this issue is more related to tsdownsample
. Given that you are the lead developer of that package, what are your thoughts on (the feasibility of) using "stride" information to downsample data (instead of the contiguous assumption)?
The error occurs on FORTRAN-style or structured arrays (where data belonging to one series do not reside in memory continuously)
Reproducing the bug :mag:
Error message:
Environment information:
Additional context It looks like the downsampler can only process strictly contiguous data. It would be good to either make it work with strides or call np.ascontiguousarray after check the C_CONTIGUOUS flag.