plotly-resampler icon indicating copy to clipboard operation
plotly-resampler copied to clipboard

Add Mypy

Open jayceslesar opened this issue 2 years ago • 2 comments

Not sure if this is wanted or not but I was playing around with this and would either need to add a lot of type: ignores to the existing code or drop support for python 3.7 in the version where mypy is included as a few of the stubs needed to correctly type out some code do not support 3.7

Happy to hack on this if wanted

jayceslesar avatar Feb 03 '23 00:02 jayceslesar

Hi @jayceslesar! 👋🏼

Glad to hear you are again willing to contribute to this package! 🚀

We are currently in the progress of altering the data-interface to something more array-alike, see #154. This PR will ease the integration with tsdownsample; a tool that will give us significant speedups regarding the data aggregation. As such, a lot of code changes lie ahead of us. I think adding mypy is a great feature; however, I would postpone it until this integration is performed!

However, there is some work that can be done.

  • We are also in the progress of developing some code in which I will integrate (something rangeslider-alike to plotly-resampler). To achieve this, I made a new layoutUpdater component => https://github.com/predict-idlab/trace-updater/pull/9. However, my JavaScript knowledge is still not optimal; and can certainly make use of an extra pair of eyes; so you could review / benchmark the PR.
  • We are also considering supporting heatmaps / 2D resampling (#71 #59 ) in plotly-resampler.
    You could for example further experiment with this and share your findings? I will link a non-optimized/rudimentary notebook which demonstrates the functionality below.
    • Are heatmaps the best? Maybe static images are faster to load? (so looking at loading times)
    • How big is the data payload; how fast / slow is an every-nth heuristic of this?
    • Which 2D resample algorithms are commonly used? (I think mean resampling is rather common)
    • Will we only support resampling in time-dimension (x-axis) or in the frequency/... (y-axis) dimension as well?
    • Creating an example in which plotly-resampler and a heatmap are used for e.g. a time-series and its short-term fourier transform.

FYI: yesterday we made a new release 0.8.3.1 (to which you contributed) 🎉

Looking forward to hearing back from you, Jonas

📂 test_heatmap_figurewidget.ipynb.zip

jonasvdd avatar Feb 03 '23 10:02 jonasvdd

haha my javascript is also not optimal but am happy to take a peek -- a rangeslider feature would be super cool. WIll play around with that notebook when I have some time as well

jayceslesar avatar Feb 06 '23 02:02 jayceslesar