Skip to content

Always restore stored curve styles (legacy styles are converted by applications on load) - #37

Merged
PierreRaybaut merged 1 commit into
developfrom
fix/legacy-curve-styles-on-load
Oct 30, 2026
Merged

PierreRaybaut merged 1 commit into
developfrom
fix/legacy-curve-styles-on-load

Conversation

@PierreRaybaut

Copy link
Copy Markdown
Contributor

Fix of an unreleased change of #29 (curve readability).

Problem

Colors and line styles stored in signal metadata were ignored at display time when they matched the automatic style cycle of earlier versions: the tab10 colors combined with one of 4 line styles, i.e. 40 combinations.

A style chosen by the user among these combinations, for example #1f77b4 with a solid line, was therefore:

  • lost when reloading a workspace;
  • removed from the metadata at the next save.

Change

  • update_plot_item_parameters always restores the stored color and line style, whatever their values.
  • CurveStyles.is_legacy_automatic remains public. Its documentation now explains that applications use it to convert data saved by earlier versions when loading them. DataLab does so for files saved by DataLab 1.3 or earlier, in the DataLab PR on the same branch.
  • Release notes 1.1.0 updated.

Tests

  • test_stored_style_is_kept: a style from the legacy cycle stored in metadata is restored and survives two save and reload cycles. It replaces test_legacy_style_is_automatic and test_partial_legacy_style_is_explicit.
  • test_user_style_from_legacy_cycle_roundtrip: #1f77b4 with SolidLine chosen by the user, over two cycles.
  • test_is_legacy_automatic: recognized pairs, case-insensitive colors, missing keys, styles outside the legacy cycle, invalid values.
  • Full SigimaX suite: 364 passed locally.

Merge order

DataLab develop currently tests the former behavior (test_legacy_styles_are_automatic). The DataLab PR on the branch fix/legacy-curve-styles-on-load must therefore be merged right after this one.

Colors and line styles stored in signal metadata were ignored when they
matched the automatic style cycle of earlier versions (tab10 colors with
one of 4 line styles), so that a style chosen by the user among these 40
combinations (e.g. #1f77b4 with a solid line) was lost when reloading
a workspace, and removed from metadata when saving it again.

Stored styles are now always restored. `is_legacy_automatic` remains
available to applications, to convert the data saved by earlier versions
when loading them (DataLab does it for workspaces saved by DataLab 1.3
or earlier).

Assisted-by: Claude Opus 5.5
@PierreRaybaut
PierreRaybaut merged commit b08e64e into develop Oct 30, 2026
8 checks passed
@PierreRaybaut
PierreRaybaut deleted the fix/legacy-curve-styles-on-load branch October 30, 2026 08:41
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