Skip to content

Commit 03faaa4

Browse files
committed
Serialize/deserialize item visibility in save_items and load_items functions
1 parent c6860f3 commit 03faaa4

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog #
22

3+
## Version 2.3.3 ##
4+
5+
In this release, test coverage is 79%.
6+
7+
🛠️ Bug fixes:
8+
9+
* Unexpected behavior regarding `io.load_items` and `io.save_items` functions:
10+
* Those functions were serializing and deserializing most of the parameters of the
11+
plot items, but not their visibility state
12+
* This is now fixed: the visibility state of the plot items is now saved and restored
13+
as expected
14+
315
## Version 2.3.2 ##
416

517
In this release, test coverage is 79%.

plotpy/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
.. _GitHub: https://github.com/PierreRaybaut/plotpy
2121
"""
2222

23-
__version__ = "2.3.2"
23+
__version__ = "2.3.3"
2424
__VERSION__ = tuple([int(number) for number in __version__.split(".")])
2525

2626
# --- Important note: DATAPATH and LOCALEPATH are used by guidata.configtools

plotpy/io.py

+2
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,7 @@ def _get_name(item):
728728
for item in items:
729729
with writer.group(_get_name(item)):
730730
item.serialize(writer)
731+
writer.write(item.isVisible(), group_name="visible")
731732
with writer.group("plot_items"):
732733
writer.write_sequence(names)
733734

@@ -756,6 +757,7 @@ def load_items(
756757
item = klass()
757758
with reader.group(name):
758759
item.deserialize(reader)
760+
item.setVisible(reader.read("visible", default=True))
759761
items.append(item)
760762
return items
761763

0 commit comments

Comments
 (0)