Skip to content

Signal auto downsampling: apply the configured maximum to all curves - #456

Merged
PierreRaybaut merged 2 commits into
developfrom
fix/455-signal-auto-downsampling
Oct 29, 2026
Merged

PierreRaybaut merged 2 commits into
developfrom
fix/455-signal-auto-downsampling

Conversation

@PierreRaybaut

Copy link
Copy Markdown
Contributor

Closes #455.

Depends on DataLab-Platform/SigimaX#31 (downsampling threshold), which closes DataLab-Platform/SigimaX#30. The DataLab CI tests this PR against the SigimaX branch of the same name.

Problems

  • Auto downsampling only started above 5 times the configured maximum number of points (fixed in SigimaX). With the default value of 100,000, signals of up to 500,000 points were drawn in full.
  • Since v1.0.0 (a9b540f), changing the sig_autodownsampling* or sig_linewidth* settings called manual_refresh(), which only refreshes the selected signals:
    • the other curves kept the former settings, even once selected again (a selection change does not update the plot items);
    • plot items made from them for dialogs (make_item(update_from=...)) inherited the stale settings.
  • The Settings dialog and the documentation gave 10,000 as the default maximum number of points, whereas the actual default value is 100,000.

Changes

Settings applied to all curves

  • New BasePlotHandler.update_existing_items():
    • it updates all existing plot items from their objects and the current settings;
    • unlike refresh_plot("existing"), it neither changes the visibility of the items nor adds the shape items again.
  • DLMainWindow.__edit_settings calls it when a sig_autodownsampling* or sig_linewidth* option changes, instead of manual_refresh().

Settings dialog

  • Actual default value of Downsampling max points (100,000).
  • Clearer help: maximum number of points displayed; data are not modified.

Documentation and translations

  • Settings documentation: display only, actual default value.
  • Release notes for 1.4.0 (Bug Fixes, Signal display).
  • French translations (UI and documentation). Only the entries changed by this PR are updated: running the translation scan in a working copy containing build/lib/datalab adds unrelated stale strings.

Before / after

Number of points drawn, with only the 2M-point signal selected when the settings are changed:

Step 150k pts 300k pts 600k pts 2M pts
Before: creation (max 100,000) 150,000 300,000 100,000 100,000
Before: max set to 10,000 150,000 300,000 100,000 10,000
After: creation (max 100,000) 75,000 100,000 100,000 100,000
After: max set to 10,000 10,000 10,000 10,000 10,000

Tests

  • New datalab/tests/features/signal/autodownsampling_unit_test.py, covering, through the Settings action:
    • the default value shown by the Settings dialog;
    • auto downsampling settings (maximum, disabling, enabling) applied to unselected curves;
    • line width applied to unselected curves;
    • visibility and number of plot items unchanged (no duplicated shape items);
    • plot items made for dialogs using the current settings.
  • 4 of these 5 tests fail without the fix. The fifth one guards the new method against duplicated shapes.
  • Local run of features/signal, features/common and backbone: 838 passed, 1 skipped.
  • The new tests also pass with the min/max downsampling of Min/max curve downsampling preserving peaks PlotPyStack/PlotPy#85 (at most maxpoints + 2 points drawn).

…lected ones

Since v1.0.0, changing the auto downsampling or line width settings only
refreshed the curves of the selected signals (`manual_refresh()`): the
other curves kept the former settings, even once selected again, and
dialogs made from them (`make_item(update_from=...)`) inherited them.

- New `BasePlotHandler.update_existing_items()`, which updates all
  existing plot items from their objects and the current settings, without
  changing their visibility nor adding shape items again (unlike
  `refresh_plot("existing")`)
- Settings: call it when `sig_autodownsampling*` or `sig_linewidth*`
  options change
- Settings dialog: actual default maximum number of points (100,000
  instead of 10,000) and clearer help
- New tests of the settings applied to unselected curves, of shape items
  and visibility, and of plot items made for dialogs

Requires DataLab-Platform/SigimaX#31 (downsampling threshold).

Closes #455

Assisted-by: Claude Opus 5.5
@PierreRaybaut
PierreRaybaut merged commit 96a1a73 into develop Oct 29, 2026
6 checks passed
@PierreRaybaut
PierreRaybaut deleted the fix/455-signal-auto-downsampling branch October 29, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant