Skip to content

Commit

Permalink
dataset.io: restored write_str method
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Nov 23, 2023
1 parent 338e32b commit b9613eb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
💥 Changes:

* `dataset.ImageChoiceItem` and `dataset.ButtonItem`: added `size` argument to set the icon size
* `dataset.io` reader and writer classes: removed unused `write_str` and `write_unicode` methods
* `dataset.io` reader and writer classes: removed deprecated `write_unicode` method

## Version 3.2.0 ##

Expand Down
3 changes: 1 addition & 2 deletions guidata/dataset/io/h5fmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def write_any(self, val: Any) -> None:
group = self.get_parent_group()
group.attrs[self.option[-1]] = val

write_list = write_int = write_float = write_any
write_str = write_list = write_int = write_float = write_any

def write_bool(self, val: bool) -> None:
"""
Expand All @@ -517,7 +517,6 @@ def write_bool(self, val: bool) -> None:
"""
self.write_int(int(val))


def write_array(self, val: np.ndarray) -> None:
"""
Write the numpy array value to the HDF5 file.
Expand Down
2 changes: 1 addition & 1 deletion guidata/dataset/io/inifmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def write_any(self, val: Any) -> None:
# alias to write_any
write_bool = (
write_int
) = write_float = write_array = write_sequence = write_dict = write_any
) = write_str = write_float = write_array = write_sequence = write_dict = write_any

def write_none(self) -> None:
"""
Expand Down
2 changes: 1 addition & 1 deletion guidata/dataset/io/jsonfmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def write_none(self):

write_sequence = (
write_dict
) = write_bool = write_int = write_float = write_array = write_any
) = write_str = write_bool = write_int = write_float = write_array = write_any

def write_object_list(self, seq, group_name):
"""Write object sequence in group.
Expand Down

0 comments on commit b9613eb

Please sign in to comment.