Repository navigation
Always restore stored curve styles (legacy styles are converted by applications on load) - #37
Merged
Merged
Conversation
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
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.
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
#1f77b4with a solid line, was therefore:Change
update_plot_item_parametersalways restores the stored color and line style, whatever their values.CurveStyles.is_legacy_automaticremains 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.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 replacestest_legacy_style_is_automaticandtest_partial_legacy_style_is_explicit.test_user_style_from_legacy_cycle_roundtrip:#1f77b4withSolidLinechosen by the user, over two cycles.test_is_legacy_automatic: recognized pairs, case-insensitive colors, missing keys, styles outside the legacy cycle, invalid values.Merge order
DataLab
developcurrently tests the former behavior (test_legacy_styles_are_automatic). The DataLab PR on the branchfix/legacy-curve-styles-on-loadmust therefore be merged right after this one.