Repository navigation
Auto downsampling: start at the configured maximum number of points - #31
Merged
Merged
Conversation
…um number of points Curves were only downsampled above 5 times `sig_autodownsampling_maxpoints` (500,000 points by default), and the factor `nbpoints // maxpoints` could draw up to 20 % more points than the maximum. - Downsample as soon as a curve has more points than the maximum, with the factor `ceil(nbpoints / maxpoints)`, so that at most this number of points is drawn - Update the drawn data when the downsampling factor alone changes - Clarify the description of `sig_autodownsampling_maxpoints` - New tests of the threshold, the factor and option changes Closes #30 Assisted-by: Claude Opus 5.5
Assisted-by: Claude Opus 5.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #30. Part of DataLab-Platform/DataLab#455.
Problem
apply_downsamplingonly downsampled a curve above 5 timessig_autodownsampling_maxpoints. With the default value (100,000), signals of up to 500,000 points were drawn in full. Its factor,nbpoints // maxpoints, could also draw up to 20 % more points than the maximum (a 599,999-point signal was drawn with 120,000 points).Changes
sig_autodownsampling_maxpoints.ceil(nbpoints / maxpoints), so that at mostmaxpointspoints are drawn (at mostmaxpoints + 2with the min/max downsampling of Min/max curve downsampling preserving peaks PlotPyStack/PlotPy#85).use_dsampupdated them).sig_autodownsampling_maxpoints: maximum number of points displayed; the data are not modified.Tests
sigimax/tests/adapters_plotpy/test_curve_downsampling.py, covering:maxpoints,5 × maxpointsand6 × maxpoints;apply_downsampling);update_itemafter option changes.develop. The new tests also pass with Min/max curve downsampling preserving peaks PlotPyStack/PlotPy#85 (min/max downsampling).