Skip to content

Commit 99783c5

Browse files
committed
Changed select_groups first argument selection
1 parent dfb97d3 commit 99783c5

3 files changed

Lines changed: 13 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Changes:
88
* Added dict-like interface (e.g. `proxy['obj123']`)
99
* Renamed `switch_to_panel` method to `set_current_panel` (compatibility with DataLab 0.9)
1010
* Added `get_current_panel` method
11+
* Changed `select_groups` first argument `selection` (compatibility with DataLab 0.9)
1112

1213
## Version 0.3.0 ##
1314

cdlclient/baseproxy.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ def __iter__(self) -> Iterator[SignalObj | ImageObj]:
4747
for uuid in uuids:
4848
yield self.get_object(uuid)
4949

50-
def __repr__(self) -> str:
51-
"""Return object representation"""
52-
return self.__str__()
53-
5450
def __str__(self) -> str:
5551
"""Return object string representation"""
52+
return super().__repr__()
53+
54+
def __repr__(self) -> str:
55+
"""Return object representation"""
5656
titles = self.get_object_titles()
5757
uuids = self.get_object_uuids()
58-
text = f"{self.__class__.__name__} (DataLab instance, {len(titles)} items):\n"
58+
text = f"{str(self)} (DataLab, {len(titles)} items):\n"
5959
for uuid, title in zip(uuids, titles):
6060
text += f" {uuid}: {title}\n"
6161
return text
@@ -249,12 +249,13 @@ def select_objects(
249249

250250
@abc.abstractmethod
251251
def select_groups(
252-
self, selection: list[int | str], panel: str | None = None
252+
self, selection: list[int | str] | None = None, panel: str | None = None
253253
) -> None:
254254
"""Select groups in current panel.
255255
256256
Args:
257-
selection (list[int | str]): List of group numbers or uuids to select
257+
selection: List of group numbers (1 to N), or list of group uuids,
258+
or None to select all groups. Defaults to None.
258259
panel (str | None): panel name (valid values: "signal", "image").
259260
If None, current panel is used. Defaults to None.
260261
"""
@@ -525,12 +526,13 @@ def select_objects(
525526
self._cdl.select_objects(selection, group_num, panel)
526527

527528
def select_groups(
528-
self, selection: list[int | str], panel: str | None = None
529+
self, selection: list[int | str] | None = None, panel: str | None = None
529530
) -> None:
530531
"""Select groups in current panel.
531532
532533
Args:
533-
selection (list[int | str]): List of group numbers or uuids to select
534+
selection: List of group numbers (1 to N), or list of group uuids,
535+
or None to select all groups. Defaults to None.
534536
panel (str | None): panel name (valid values: "signal", "image").
535537
If None, current panel is used. Defaults to None.
536538
"""

cdlclient/tests/remoteclient_unit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def multiple_commands(remote: SimpleRemoteProxy):
5656
assert len(items) == 1 and items[0].get_rect() == area
5757
execenv.print("OK")
5858
remote.add_label_with_title(f"Image uuid: {uuid}")
59-
remote.select_groups([0])
59+
remote.select_groups([1])
6060
remote.select_objects([uuid])
6161
remote.delete_metadata()
6262

0 commit comments

Comments
 (0)