Skip to content

Commit 5ccbc70

Browse files
🏷️ mypy Update Typing in utils.py (#951)
- Updates type annotations in the `utils/misc.py` file to improve mypy compliance --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 318aa32 commit 5ccbc70

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tiatoolbox/utils/misc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import tempfile
99
import zipfile
1010
from pathlib import Path
11-
from typing import IO, TYPE_CHECKING
11+
from typing import IO, TYPE_CHECKING, cast
1212

1313
import cv2
1414
import joblib
@@ -1304,7 +1304,7 @@ def process_contours(
13041304

13051305

13061306
def dict_to_store_semantic_segmentor(
1307-
patch_output: dict | zarr.group,
1307+
patch_output: dict | zarr.Group,
13081308
scale_factor: tuple[float, float],
13091309
class_dict: dict | None = None,
13101310
save_path: Path | None = None,
@@ -1352,6 +1352,7 @@ def dict_to_store_semantic_segmentor(
13521352
cv2.RETR_CCOMP,
13531353
cv2.CHAIN_APPROX_NONE,
13541354
)
1355+
contours = cast("list[np.ndarray]", contours)
13551356

13561357
annotations_list_ = process_contours(contours, hierarchy, scale_factor)
13571358
annotations_list.extend(annotations_list_)

0 commit comments

Comments
 (0)