Skip to content
Merged
8 changes: 7 additions & 1 deletion src/psygnal/_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,13 @@ def _inner(slot: Callable) -> Callable:
return _inner if slot is None else _inner(slot)

def block(self, exclude: Container[str | SignalInstance] = ()) -> None:
"""Block this signal and all emitters from emitting."""
"""Block this signal and all emitters from emitting.

Parameters
----------
exclude : Container[str | SignalInstance]
Signals to exclude from blocking, given by name or instance.
"""
super().block()
for name, sig in self._signals.items():
if name in exclude or sig in exclude:
Expand Down
2 changes: 1 addition & 1 deletion src/psygnal/_group_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ def connect_child_events(
This is useful when you have a tree of objects, and you want to connect all
events from the children to the parent.

Parameters.
Parameters
----------
obj : object
The object to connect events from. If it is not evented, this function will
Expand Down
10 changes: 9 additions & 1 deletion src/psygnal/containers/_evented_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,15 @@ def __hash__(self) -> int:
)

def reverse(self, *, emit_individual_events: bool = False) -> None:
"""Reverse list *IN PLACE*."""
"""Reverse list *IN PLACE*.

Parameters
----------
emit_individual_events : bool
If True, the list is reversed one item at a time, emitting per-item
events; otherwise the underlying data is reversed directly, by
default False
"""
if emit_individual_events:
super().reverse()
else:
Expand Down
22 changes: 20 additions & 2 deletions src/psygnal/containers/_selectable_evented_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ def _on_item_removed(self, idx: int, obj: Any) -> None:
self.selection.discard(obj)

def insert(self, index: int, value: _T) -> None:
"""Insert item(s) into the list and update the selection."""
"""Insert item(s) into the list and update the selection.

Parameters
----------
index : int
The index at which to insert the item.
value : _T
The item to insert.
"""
super().insert(index, value)
if self._activate_on_insert:
self.selection.active = value
Expand Down Expand Up @@ -102,7 +110,17 @@ def select_next(
def select_previous(
self, expand_selection: bool = False, wraparound: bool = False
) -> None:
"""Select the previous item in the list."""
"""Select the previous item in the list.

Parameters
----------
expand_selection : bool
If True, will expand the selection to contain both the current item and
the previous item, by default False
wraparound : bool
Whether to return to the end of the list if the beginning has been
reached, by default False
"""
self.select_next(
step=-1, expand_selection=expand_selection, wraparound=wraparound
)
Expand Down
8 changes: 7 additions & 1 deletion src/psygnal/containers/_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ def selection(self) -> Selection[_S]: # pragma: no cover

@selection.setter
def selection(self, new_selection: Iterable[_S]) -> None: # pragma: no cover
"""Set selection, without deleting selection model object."""
"""Set selection, without deleting selection model object.

Parameters
----------
new_selection : Iterable[_S]
The items to select.
"""
self._selection.intersection_update(new_selection)
self._selection.update(new_selection)
2 changes: 2 additions & 0 deletions src/psygnal/qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def start_emitting_from_queue(
def stop_emitting_from_queue(thread: Thread | None = None) -> None:
"""Stop the QTimer that monitors the global emission queue.

Parameters
----------
thread : Thread, optional
The thread in which to stop the QTimer. By default, will stop any QTimers
in the thread from which this function is called.
Expand Down
Loading