Skip to content

Commit

Permalink
Make transform policy kw-only
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max authored Jan 28, 2025
1 parent 64d0020 commit dbe2918
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/datumaro/components/dataset_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def __init__(
self,
source: IDataset,
transforms: List[PostponedTransform],
*,
raise_on_malformed_transform: bool = True,
):
super().__init__(source)
Expand Down Expand Up @@ -138,6 +139,7 @@ def __init__(
categories: Optional[CategoriesInfo] = None,
media_type: Optional[Type[MediaElement]] = None,
ann_types: Optional[Set[AnnotationType]] = None,
*,
raise_on_malformed_transform: bool = True,
):
self._raise_on_malformed_transform = raise_on_malformed_transform
Expand Down Expand Up @@ -272,7 +274,9 @@ def _add_ann_types(item: DatasetItem):
old_ids = None
if self._transforms:
transform = _StackedTransform(
source, self._transforms, self._raise_on_malformed_transform
source,
self._transforms,
raise_on_malformed_transform=self._raise_on_malformed_transform
)
if transform.is_local:
# An optimized way to find modified items:
Expand Down Expand Up @@ -675,6 +679,7 @@ def __init__(
categories: Optional[CategoriesInfo] = None,
media_type: Optional[Type[MediaElement]] = None,
ann_types: Optional[Set[AnnotationType]] = None,
*,
raise_on_malformed_transform: bool = True,
):
if not source.is_stream:
Expand Down

0 comments on commit dbe2918

Please sign in to comment.