Skip to content

Commit 8f7a3e7

Browse files
committed
UPD: Fix deepsource issues
1 parent ed18c17 commit 8f7a3e7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tiatoolbox/utils/postproc_defs.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import colorsys
66
import warnings
7-
from typing import Any
87

98
import numpy as np
109

@@ -115,7 +114,11 @@ def __call__(self: MultichannelToRGB, image: np.ndarray) -> np.ndarray:
115114
# Clip to ensure in valid range and return
116115
return np.clip(rgb_image, 0, 255).astype(np.uint8)
117116

118-
def __setattr__(self: MultichannelToRGB, name: str, value: Any) -> None:
117+
def __setattr__(
118+
self: MultichannelToRGB,
119+
name: str,
120+
value: dict[str, tuple[int, int, int]] | None,
121+
) -> None:
119122
"""Ensure that colors is updated if color_dict is updated."""
120123
if name == "color_dict" and value is not None:
121124
self.colors = np.array(list(value.values()), dtype=np.float32)

0 commit comments

Comments
 (0)