Skip to content

Commit

Permalink
Fixed/Added annotations/docstrings in some modules
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRaybaut committed Sep 28, 2023
1 parent 7c2c4ca commit 5257a12
Show file tree
Hide file tree
Showing 4 changed files with 293 additions and 158 deletions.
78 changes: 13 additions & 65 deletions guidata/dataset/qtitemwidgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,7 @@ def set(self) -> None:
self.item.set_from_string(self.value())

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
pass

def value(self) -> Any:
Expand Down Expand Up @@ -218,11 +214,7 @@ def __init__(
self.group.setLayout(self.layout)

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
self.edit.update_widgets()

def set(self) -> None:
Expand Down Expand Up @@ -298,11 +290,7 @@ def __init__(
self.widgets.append(widget)

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
for widget in self.widgets:
widget.get()

Expand Down Expand Up @@ -367,11 +355,7 @@ def __init__(
self.edit.textChanged.connect(self.line_edit_changed) # type:ignore

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
value = self.item.get()
old_value = str(self.value())
if value is not None:
Expand Down Expand Up @@ -438,11 +422,7 @@ def __get_text(self) -> str:
return str(self.edit.toPlainText()).replace("\u2029", os.linesep)

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
value = self.item.get()
if value is not None:
self.edit.setPlainText(value)
Expand Down Expand Up @@ -496,11 +476,7 @@ def __init__(
self.checkbox.stateChanged.connect(self.state_changed) # type:ignore

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
value = self.item.get()
if value is not None:
self.checkbox.setChecked(value)
Expand Down Expand Up @@ -576,11 +552,7 @@ def date_changed(self, value):
self.notify_value_change()

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
value = self.item.get()
if value:
if not isinstance(value, datetime.date):
Expand Down Expand Up @@ -629,11 +601,7 @@ def date_changed(self, value):
self.notify_value_change()

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
value = self.item.get()
if value:
if not isinstance(value, datetime.datetime):
Expand Down Expand Up @@ -1004,11 +972,7 @@ def get_widget_value(self) -> Optional[int]:
return self.combobox.currentIndex()

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
self.initialize_widget()
value = self.item.get()
if value is not None:
Expand Down Expand Up @@ -1074,11 +1038,7 @@ def __init__(
self.groupbox.setLayout(layout)

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
value = self.item.get()
_choices = self.item.get_prop_value("data", "choices")
for (i, _choice, _img), checkbox in zip(_choices, self.boxes):
Expand Down Expand Up @@ -1172,11 +1132,7 @@ def edit_array(self) -> None:
self.update(self.arr)

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
self.arr = numpy.array(self.item.get(), copy=False)
if self.item.get_prop_value("display", "transpose"):
self.arr = self.arr.T
Expand Down Expand Up @@ -1276,11 +1232,7 @@ def __init__(
self.cb_value = None

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
self.cb_value = self.item.get()

def set(self) -> None:
Expand Down Expand Up @@ -1355,11 +1307,7 @@ def __init__(
)

def get(self) -> None:
"""Update widget contents from data item value
Returns:
Widget value
"""
"""Update widget contents from data item value"""
self.get_dataset()
for widget in self.edit.widgets:
widget.get()
Expand Down
Loading

0 comments on commit 5257a12

Please sign in to comment.