Skip to content

Commit b1216ce

Browse files
authored
optional slice param (#441)
1 parent e35d823 commit b1216ce

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

nucleus/dataset.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1449,10 +1449,13 @@ def items_and_annotations(
14491449
)
14501450
return convert_export_payload(api_payload[EXPORTED_ROWS])
14511451

1452-
def scene_and_annotation_generator(self, page_size: int = 10):
1452+
def scene_and_annotation_generator(
1453+
self, sliceId=None, page_size: int = 10
1454+
):
14531455
"""Provides a generator of all Scenes and Annotations in the dataset grouped by scene.
14541456
14551457
Args:
1458+
sliceId: Optional slice ID to filter the scenes and annotations.
14561459
page_size: Number of scenes to fetch per page. Default is 10.
14571460
14581461
Returns:
@@ -1505,6 +1508,7 @@ def scene_and_annotation_generator(self, page_size: int = 10):
15051508
endpoint=f"dataset/{self.id}/{endpoint_name}",
15061509
result_key=EXPORT_FOR_TRAINING_KEY,
15071510
page_size=page_size,
1511+
sliceId=sliceId,
15081512
)
15091513

15101514
for data in json_generator:

0 commit comments

Comments
 (0)