Skip to content

Commit

Permalink
add a method to add sample ids to a dataset (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalozeryflato authored Aug 31, 2023
1 parent 8f22cd4 commit e94fa93
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fuse/data/datasets/dataset_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ def get_all_sample_ids(self) -> List[Any]:
def set_final_sample_ids(self, final_sample_ids: List[Any]) -> None:
self._final_sample_ids = final_sample_ids

def add_sample_ids_and_recreate(
self, added_sample_ids: List[Any], **kwargs: Dict
) -> None:
self._orig_sample_ids = self._final_sample_ids + added_sample_ids
self._created = False
self.create(**kwargs)

def __getitem__(self, item: Union[int, Hashable]) -> NDict:
"""
Get sample, read from cache if possible
Expand Down

0 comments on commit e94fa93

Please sign in to comment.