Repository navigation
Keep user curve styles; convert legacy automatic styles when loading DataLab <= 1.3 files - #464
Merged
Merged
Conversation
…files Since SigimaX always restores stored curve styles, the automatic styles that DataLab 1.3 and earlier stored in signal metadata are now removed when loading native HDF5 files (workspaces, history files) saved by these versions, so that their curves get the current automatic styles. Styles stored by later versions are always kept, including user styles identical to an automatic style of earlier versions (e.g. #1f77b4 with a solid line), which were lost when reloading a workspace. - `NativeH5Reader.saved_version` (decoded once) and `NativeH5Reader.has_legacy_curve_styles`, based on `is_legacy_style_version` (release < 1.4; missing or invalid versions keep stored styles); `H5InputOutput` uses `saved_version` - `SignalPanel.deserialize_object_from_hdf5` removes `color` and `style` when the file is legacy and the pair is a legacy automatic style - Tests: legacy workspace and history file converted, current files kept, user style from the legacy cycle kept over two round trips, version parsing; headless reader test double updated to the reader contract - Documentation, release notes and French translations 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 #454 (curve readability). Depends on DataLab-Platform/SigimaX#37, on the same branch name, which is cloned by the CI.
Problem
Since #454, SigimaX ignored stored curve styles at display time when they matched the automatic style cycle of DataLab 1.3 or earlier (tab10 colors with one of 4 line styles). A style chosen by the user among these 40 combinations, for example
#1f77b4with a solid line, was therefore:Change
SigimaX now always restores stored styles (DataLab-Platform/SigimaX#37). The automatic styles stored by older versions are therefore converted once, when DataLab loads their files.
Native HDF5 reader
NativeH5Reader.saved_version: version that saved the file, decoded once whether it is stored as a string or as bytes.H5InputOutputnow uses it, instead of its own private method.NativeH5Reader.has_legacy_curve_styles, based onis_legacy_style_version:packaging), so pre-releases of 1.4 are not legacy;Signal loading
SignalPanel.deserialize_object_from_hdf5removescolorandstylewhen the file is legacy and the pair belongs to the old automatic cycle. The conversion happens before the plot items are created..dlhistfiles, both when loaded into an empty workspace and when imported into a workspace in use.Documentation
Tests
curve_styles_unit_test.py:DataLab_Versionis rewritten to1.3.0is converted, while a legacy color withDotLineis kept;.dlhistfile dated 1.3 is converted when imported into a workspace in use;#1f77b4withSolidLinechosen by the user survives two HDF5 cycles;1.4.0rc1,1.4.0.dev0,1.10.0, invalid values,None).native_reader_unit_test.py:saved_versionstored as a string, as bytes, or invalid.test_open_file_headless_refreshes_reference_displays: its reader test double now providessaved_version, as the reader does.SignalPanel, both legacy loading tests fail.signal,hdf5,common,backbone,image,pluginsandcontrolsuites: 1103 passed, 3 skipped.