Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💪 handle nans #24

Closed
jvdd opened this issue Jan 23, 2023 · 2 comments · Fixed by #59
Closed

💪 handle nans #24

jvdd opened this issue Jan 23, 2023 · 2 comments · Fixed by #59
Labels
enhancement New feature or request

Comments

@jvdd
Copy link
Member

jvdd commented Jan 23, 2023

Assuming that there are no NaNs in the data is the largest assumption that this library makes.

Why is this a large assumption

Plotting libraries use NaN values to represent gaps (i.e., disconnected parts of the time series).

How should we tackle / handle NaNs

Ideally we would have a NaN-policy. Currently I see only 2 options that this policy should support:

  • omit NaNs (skip / ignore them when performing the downsampling)
  • return NaN once there is one present in the considered data (e.g., in the bin)

For the MinMaxDownsampler, M4Downsampler, and (largely) the MinMaxLTTBDownsampler, this would boil down to adding NaN support (with some sort policy as described above) to the argminmax crate.

How we would support NaNs in the LTTBDownsampler is not yet 100% clear to me.

@jvdd jvdd added the enhancement New feature or request label Jan 23, 2023
@gfmartins
Copy link

Don't know if this helps, but timescaledb implements an gap preserving function for the LTTB algorithm
https://docs.timescale.com/api/latest/hyperfunctions/downsample/gp_lttb/

source: https://github.com/timescale/timescaledb-toolkit/blob/7fc374999160c42b55c8be3c3723314ec129a354/extension/src/lttb.rs

@jvdd
Copy link
Member Author

jvdd commented Jan 30, 2023

Looks quite interesting - will look into it! Perhaps we can integrate / re-use functionality :)

Thanks for sharing this @gfmartins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants