Skip to content

Commit 1ca07dc

Browse files
committed
Implement add_group method to allow adding groups to DataLab
1 parent 6c0f3da commit 1ca07dc

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

cdlclient/baseproxy.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,18 @@ def add_image(
233233
ValueError: Invalid data dtype
234234
"""
235235

236+
@abc.abstractmethod
237+
def add_group(
238+
self, title: str, panel: str | None = None, select: bool = False
239+
) -> None:
240+
"""Add group to DataLab.
241+
242+
Args:
243+
title: Group title
244+
panel: Panel name (valid values: "signal", "image"). Defaults to None.
245+
select: Select the group after creation. Defaults to False.
246+
"""
247+
236248
@abc.abstractmethod
237249
def get_sel_object_uuids(self, include_groups: bool = False) -> list[str]:
238250
"""Return selected objects uuids.
@@ -598,6 +610,18 @@ def load_from_files(self, filenames: list[str]) -> None:
598610
"""
599611
self._cdl.load_from_files(filenames)
600612

613+
def add_group(
614+
self, title: str, panel: str | None = None, select: bool = False
615+
) -> None:
616+
"""Add group to DataLab.
617+
618+
Args:
619+
title: Group title
620+
panel: Panel name (valid values: "signal", "image"). Defaults to None.
621+
select: Select the group after creation. Defaults to False.
622+
"""
623+
self._cdl.add_group(title, panel, select)
624+
601625
def get_sel_object_uuids(self, include_groups: bool = False) -> list[str]:
602626
"""Return selected objects uuids.
603627

0 commit comments

Comments
 (0)