Skip to content

Commit 0425917

Browse files
committed
precommit fixes
1 parent 41d2fee commit 0425917

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

tiatoolbox/models/dataset/classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def __init__( # skipcq: PY-R1000 # noqa: PLR0915
322322
# mask on the fly
323323
try:
324324
mask_reader = self.reader.tissue_mask(resolution=1.25, units="power")
325-
except:
325+
except ValueError:
326326
# if power is None, try with mpp
327327
mask_reader = self.reader.tissue_mask(resolution=6.0, units="mpp")
328328
# ? will this mess up ?

tiatoolbox/visualization/bokeh_app/main.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def get_channel_info() -> dict[str, tuple[int, int, int]]:
146146
resp = json.loads(resp.text)
147147
return resp.get("channels", {}), resp.get("active", [])
148148
except json.JSONDecodeError as e:
149-
logger.warning(f"Error decoding JSON: {e}")
149+
logger.warning("Error decoding JSON: %s", e)
150150
return {}, []
151151

152152

@@ -221,7 +221,11 @@ def create_channel_color_ui() -> Column:
221221

222222
color_picker = ColorPicker(title="Channel Color", width=100)
223223

224-
def update_selected_color(attr: str, old: str, new: str) -> None: # noqa: ARG001
224+
def update_selected_color( # noqa: ARG001 # skipcq: PYL-W0613
225+
attr: str,
226+
old: str,
227+
new: str
228+
) -> None:
225229
"""Update the selected color in multichannel ui."""
226230
selected = color_source.selected.indices
227231
if selected:
@@ -243,7 +247,10 @@ def apply_changes() -> None:
243247

244248
apply_button.on_click(apply_changes)
245249

246-
def update_color_picker(attr: str, old: str, new: str) -> None: # noqa: ARG001
250+
def update_color_picker( # noqa: ARG001 # skipcq: PYL-W0613
251+
attr: str,
252+
old: str,
253+
new: str) -> None:
247254
"""Update the color picker when a new channel is selected."""
248255
if new:
249256
selected_color = color_source.data["colors"][new[0]]
@@ -262,7 +269,10 @@ def update_color_picker(attr: str, old: str, new: str) -> None: # noqa: ARG001
262269
width=200,
263270
)
264271

265-
def enhance_cb(attr: str, old: str, new: str) -> None: # noqa: ARG001 # skipcq: PYL-W0613
272+
def enhance_cb( # noqa: ARG001 # skipcq: PYL-W0613
273+
attr: str,
274+
old: str,
275+
new: str) -> None:
266276
"""Enhance slider callback."""
267277
UI["s"].put(
268278
f"http://{host2}:5000/tileserver/enhance",
@@ -929,14 +939,14 @@ def populate_slide_list(slide_folder: Path, search_txt: str | None = None) -> No
929939
UI["slide_select"].options = file_list
930940

931941

932-
def filter_input_cb(attr: str, old: str, new: str) -> None: # noqa: ARG001
942+
def filter_input_cb(attr: str, old: str, new: str) -> None: # noqa: ARG001 # skipcq: PYL-W0613
933943
"""Change predicate to be used to filter annotations."""
934944
build_predicate()
935945
UI["vstate"].update_state = 1
936946
UI["vstate"].to_update.update(["overlay"])
937947

938948

939-
def cprop_input_cb(attr: str, old: str, new: list[str]) -> None: # noqa: ARG001
949+
def cprop_input_cb(attr: str, old: str, new: list[str]) -> None: # noqa: ARG001 # skipcq: PYL-W0613
940950
"""Change property to color by."""
941951
if len(new) == 0:
942952
return

0 commit comments

Comments
 (0)