5353
5454
5555Instance = TypeVar ("Instance" )
56- Value = TypeVar ("Value" )
5756
5857
59- class FieldDescriptor ( Generic [Value ]) :
58+ class FieldDescriptor [Value ]:
6059 """Descriptor for Anomalib's dataclass fields.
6160
6261 Using a descriptor ensures that the values of dataclass fields can be
@@ -160,7 +159,7 @@ def is_optional(self, owner: type[Instance]) -> bool:
160159
161160
162161@dataclass
163- class _InputFields (Generic [T , ImageT , MaskT , PathT ], ABC ):
162+ class _InputFields (Generic [T , ImageT , MaskT , PathT ], ABC ): # noqa: UP046
164163 """Generic dataclass that defines the standard input fields for Anomalib.
165164
166165 This abstract base class provides a structure for input data used in Anomalib.
@@ -258,7 +257,7 @@ def validate_gt_label(gt_label: T) -> T | None:
258257
259258
260259@dataclass
261- class _ImageInputFields (Generic [PathT ], ABC ):
260+ class _ImageInputFields (Generic [PathT ], ABC ): # noqa: UP046
262261 """Generic dataclass for image-specific input fields in Anomalib.
263262
264263 This class extends standard input fields with an ``image_path`` attribute for
@@ -295,7 +294,7 @@ def validate_image_path(image_path: PathT) -> PathT | None:
295294
296295
297296@dataclass
298- class _VideoInputFields (Generic [T , ImageT , MaskT , PathT ], ABC ):
297+ class _VideoInputFields (Generic [T , ImageT , MaskT , PathT ], ABC ): # noqa: UP046
299298 """Generic dataclass that defines the video input fields for Anomalib.
300299
301300 This class extends standard input fields with attributes specific to
@@ -411,7 +410,7 @@ def validate_last_frame(last_frame: T) -> T | None:
411410
412411
413412@dataclass
414- class _DepthInputFields (Generic [T , PathT ], _ImageInputFields [PathT ], ABC ):
413+ class _DepthInputFields (Generic [T , PathT ], _ImageInputFields [PathT ], ABC ): # noqa: UP046
415414 """Generic dataclass that defines the depth input fields for Anomalib.
416415
417416 This class extends standard input fields with depth-specific attributes for
@@ -473,7 +472,7 @@ def validate_depth_path(depth_path: PathT) -> PathT | None:
473472
474473
475474@dataclass
476- class _OutputFields (Generic [T , MaskT , PathT ], ABC ):
475+ class _OutputFields (Generic [T , MaskT , PathT ], ABC ): # noqa: UP046
477476 """Generic dataclass that defines the standard output fields for Anomalib.
478477
479478 This class defines the standard output fields used in Anomalib, including
@@ -640,7 +639,7 @@ def update(self, in_place: bool = True, **changes) -> Any: # noqa: ANN401
640639@dataclass
641640class _GenericItem (
642641 UpdateMixin ,
643- Generic [T , ImageT , MaskT , PathT ],
642+ Generic [T , ImageT , MaskT , PathT ], # noqa: UP046
644643 _OutputFields [T , MaskT , PathT ],
645644 _InputFields [T , ImageT , MaskT , PathT ],
646645):
@@ -669,7 +668,7 @@ class _GenericItem(
669668@dataclass
670669class _GenericBatch (
671670 UpdateMixin ,
672- Generic [T , ImageT , MaskT , PathT ],
671+ Generic [T , ImageT , MaskT , PathT ], # noqa: UP046
673672 _OutputFields [T , MaskT , PathT ],
674673 _InputFields [T , ImageT , MaskT , PathT ],
675674):
@@ -696,7 +695,7 @@ class _GenericBatch(
696695
697696
698697@dataclass
699- class BatchIterateMixin (Generic [ItemT ]):
698+ class BatchIterateMixin (Generic [ItemT ]): # noqa: UP046
700699 """Mixin class for iterating over batches of items in Anomalib datasets.
701700
702701 This class provides functionality to iterate over individual items within a
0 commit comments