Skip to content

Commit c22f887

Browse files
committed
Fix formatting in CHANGELOG.md for improved readability and consistency
1 parent 558198d commit c22f887

File tree

1 file changed

+74
-74
lines changed

1 file changed

+74
-74
lines changed

CHANGELOG.md

Lines changed: 74 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
* Enables easy data interchange, storage, and transmission of DataSet configurations
1212
* Example usage:
1313

14-
```python
15-
from guidata.dataset import dataset_to_json, json_to_dataset
14+
```python
15+
from guidata.dataset import dataset_to_json, json_to_dataset
1616

17-
# Serialize to JSON
18-
json_str = dataset_to_json(my_dataset)
17+
# Serialize to JSON
18+
json_str = dataset_to_json(my_dataset)
1919

20-
# Deserialize from JSON
21-
restored_dataset = json_to_dataset(json_str)
22-
```
20+
# Deserialize from JSON
21+
restored_dataset = json_to_dataset(json_str)
22+
```
2323

2424
* **DataSet Class-Level Configuration**: Added support for configuring DataSet metadata at the class definition level using `__init_subclass__`:
2525
* DataSet title, comment, icon, and readonly state can now be configured directly in the class inheritance declaration
@@ -30,22 +30,22 @@
3030
* Backward compatibility: When no title is set at all, docstring first line is still used as title (old behavior)
3131
* Example usage:
3232

33-
```python
34-
class MyParameters(DataSet,
35-
title="Analysis Parameters",
36-
comment="Configure your analysis options",
37-
icon="params.png"):
38-
"""This docstring is for developer documentation only"""
33+
```python
34+
class MyParameters(DataSet,
35+
title="Analysis Parameters",
36+
comment="Configure your analysis options",
37+
icon="params.png"):
38+
"""This docstring is for developer documentation only"""
3939

40-
threshold = FloatItem("Threshold", default=0.5)
41-
method = StringItem("Method", default="auto")
40+
threshold = FloatItem("Threshold", default=0.5)
41+
method = StringItem("Method", default="auto")
4242

43-
# No need to pass title when instantiating
44-
params = MyParameters()
43+
# No need to pass title when instantiating
44+
params = MyParameters()
4545

46-
# Can still override at instance level if needed
47-
params_custom = MyParameters(title="Custom Title")
48-
```
46+
# Can still override at instance level if needed
47+
params_custom = MyParameters(title="Custom Title")
48+
```
4949

5050
* Priority order: instance parameter > class-level config > empty/default
5151
* Makes it explicit when title is intentionally set vs. accidentally left empty
@@ -58,22 +58,22 @@
5858
* Separators don't store any data - they are purely visual elements for organizing forms
5959
* Example usage:
6060

61-
```python
62-
class PersonDataSet(DataSet):
63-
name = StringItem("Name", default="John Doe")
64-
age = IntItem("Age", default=30)
61+
```python
62+
class PersonDataSet(DataSet):
63+
name = StringItem("Name", default="John Doe")
64+
age = IntItem("Age", default=30)
6565

66-
# Visual separator with label
67-
sep1 = SeparatorItem("Contact Information")
66+
# Visual separator with label
67+
sep1 = SeparatorItem("Contact Information")
6868

69-
email = StringItem("Email", default="[email protected]")
70-
phone = StringItem("Phone", default="123-456-7890")
69+
email = StringItem("Email", default="[email protected]")
70+
phone = StringItem("Phone", default="123-456-7890")
7171

72-
# Visual separator without label
73-
sep2 = SeparatorItem()
72+
# Visual separator without label
73+
sep2 = SeparatorItem()
7474

75-
notes = StringItem("Notes", default="Additional notes")
76-
```
75+
notes = StringItem("Notes", default="Additional notes")
76+
```
7777

7878
* Improves readability and visual organization of complex datasets
7979
* Fully integrated with existing DataSet serialization/deserialization (separators are ignored during save/load)
@@ -85,16 +85,16 @@
8585
* Computed items are automatically read-only and update in real-time when their dependencies change
8686
* Example usage:
8787

88-
```python
89-
class DataSet(gdt.DataSet):
88+
```python
89+
class DataSet(gdt.DataSet):
9090

91-
def compute_sum(self) -> float:
92-
return self.x + self.y
91+
def compute_sum(self) -> float:
92+
return self.x + self.y
9393

94-
x = gdt.FloatItem("X", default=1.0)
95-
y = gdt.FloatItem("Y", default=2.0)
96-
sum_xy = gdt.FloatItem("Sum", default=0.0).set_computed(compute_sum)
97-
```
94+
x = gdt.FloatItem("X", default=1.0)
95+
y = gdt.FloatItem("Y", default=2.0)
96+
sum_xy = gdt.FloatItem("Sum", default=0.0).set_computed(compute_sum)
97+
```
9898

9999
* Computed items automatically display with visual distinction (neutral background color) in GUI forms
100100
* Supports complex calculations and can access any other items in the dataset
@@ -115,19 +115,19 @@
115115
* Proper handling of None values (displayed as "-") and nested ObjectItem datasets
116116
* Example usage:
117117

118-
```python
119-
class PersonDataSet(DataSet):
120-
"""Personal Information Dataset
118+
```python
119+
class PersonDataSet(DataSet):
120+
"""Personal Information Dataset
121121
122-
This dataset collects basic personal information.
123-
"""
124-
name = StringItem("Full Name", default="John Doe")
125-
age = IntItem("Age", default=30)
126-
active = BoolItem("Account Active", default=True)
122+
This dataset collects basic personal information.
123+
"""
124+
name = StringItem("Full Name", default="John Doe")
125+
age = IntItem("Age", default=30)
126+
active = BoolItem("Account Active", default=True)
127127

128-
dataset = PersonDataSet()
129-
html_output = dataset.to_html() # Generate HTML representation
130-
```
128+
dataset = PersonDataSet()
129+
html_output = dataset.to_html() # Generate HTML representation
130+
```
131131

132132
* Ideal for reports, documentation, and web-based dataset visualization
133133
* Comprehensive unit test coverage ensures reliability across all item types
@@ -147,10 +147,10 @@
147147
* The `readonly` property is now respected in the corresponding widgets (see `guidata.dataset.qtitemwidgets`).
148148
* Example usage:
149149

150-
```python
151-
text = gds.TextItem("Text", default="Multi-line text", readonly=True)
152-
string = gds.StringItem("String", readonly=True)
153-
```
150+
```python
151+
text = gds.TextItem("Text", default="Multi-line text", readonly=True)
152+
string = gds.StringItem("String", readonly=True)
153+
```
154154

155155
* Note: Any other item type can also be turned into read-only mode by using `set_prop("display", readonly=True)`. This is a generic mechanism, but the main use case is for `StringItem` and `TextItem` (hence the dedicated input parameter for convenience).
156156

@@ -171,11 +171,11 @@
171171
* `ValidationMode.STRICT`: validation is performed, and exceptions are raised if the value is invalid
172172
* To use these validation modes, you need to set the option:
173173

174-
```python
175-
from guidata.config import set_validation_mode, ValidationMode
174+
```python
175+
from guidata.config import set_validation_mode, ValidationMode
176176

177-
set_validation_mode(ValidationMode.STRICT)
178-
```
177+
set_validation_mode(ValidationMode.STRICT)
178+
```
179179

180180
* New `check_callback` parameter for `FloatArrayItem`:
181181
* The `check_callback` parameter allows you to specify a custom validation function for the item.
@@ -214,21 +214,21 @@
214214
* This enables API flexibility while maintaining type safety, allowing users to pass either enum instances or their string representations interchangeably
215215
* Example usage:
216216

217-
```python
218-
class ProcessingMode(LabeledEnum):
219-
FAST = ("fast_mode", "Fast Processing")
220-
ACCURATE = ("accurate_mode", "Accurate Processing")
221-
222-
def process_data(mode):
223-
if mode == ProcessingMode.FAST: # Works with both enum and string
224-
return "fast_processing"
225-
# ...
226-
227-
# Both calls work identically:
228-
result1 = process_data(ProcessingMode.FAST) # Using enum
229-
result2 = process_data("fast_mode") # Using string
230-
# result1 == result2 is True!
231-
```
217+
```python
218+
class ProcessingMode(LabeledEnum):
219+
FAST = ("fast_mode", "Fast Processing")
220+
ACCURATE = ("accurate_mode", "Accurate Processing")
221+
222+
def process_data(mode):
223+
if mode == ProcessingMode.FAST: # Works with both enum and string
224+
return "fast_processing"
225+
# ...
226+
227+
# Both calls work identically:
228+
result1 = process_data(ProcessingMode.FAST) # Using enum
229+
result2 = process_data("fast_mode") # Using string
230+
# result1 == result2 is True!
231+
```
232232

233233
* `StringItem` behavior change:
234234
* The `StringItem` class now uses the new validation modes (see above).

0 commit comments

Comments
 (0)