Skip to content

Commit 17f8678

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 9a0ed9b commit 17f8678

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

tests/test_tiffreader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
"""Test TIFFWSIReader."""
22

33
from __future__ import annotations
4-
from collections.abc import Callable
54

6-
from typing import TYPE_CHECKING, Callable
5+
from collections.abc import Callable
6+
from typing import TYPE_CHECKING
77
from unittest.mock import patch
88

99
import cv2

tests/test_wsireader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
import logging
99
import re
1010
import shutil
11+
from collections.abc import Callable
1112
from copy import deepcopy
1213
from pathlib import Path
1314
from types import SimpleNamespace
14-
from typing import TYPE_CHECKING, Callable
15+
from typing import TYPE_CHECKING
1516
from unittest.mock import patch
1617

1718
import cv2

tiatoolbox/visualization/bokeh_app/main.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,13 @@ def update_selected_color(
241241

242242
def apply_changes() -> None:
243243
"""Apply the changes to the image."""
244-
colors = dict(zip(channel_source.data["channels"], color_source.data["colors"]))
244+
colors = dict(
245+
zip(
246+
channel_source.data["channels"],
247+
color_source.data["colors"],
248+
strict=False,
249+
)
250+
)
245251
active_channels = channel_source.selected.indices
246252

247253
set_channel_info({ch: hex2rgb(colors[ch]) for ch in colors}, active_channels)

tiatoolbox/wsicore/wsireader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3790,6 +3790,7 @@ def _parse_scancolortable(
37903790
for k, v in zip(
37913791
color_info.iterfind("ScanColorTable-k"),
37923792
color_info.iterfind("ScanColorTable-v"),
3793+
strict=False,
37933794
)
37943795
}
37953796
# values will be either a string of 3 ints e.g 155, 128, 0, or
@@ -3827,7 +3828,7 @@ def _parse_filtercolor_metadata(
38273828

38283829
keys = filter_colors_section.findall(".//FilterColors-k")
38293830
vals = filter_colors_section.findall(".//FilterColors-v")
3830-
for k, v in zip(keys, vals):
3831+
for k, v in zip(keys, vals, strict=False):
38313832
filter_colors[k.text] = v.text
38323833

38333834
# Helper function to convert color strings like "Lime" or

0 commit comments

Comments
 (0)