Skip to content

Commit 674201c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 692d240 commit 674201c

File tree

3 files changed

+33
-33
lines changed

3 files changed

+33
-33
lines changed

tests/test_annotation_tilerendering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def sub_tile_level_count(self: MockTileGenerator) -> int:
271271

272272

273273
def test_unknown_geometry(
274-
fill_store: Callable, # noqa: ARG001
274+
fill_store: Callable,
275275
caplog: pytest.LogCaptureFixture,
276276
) -> None:
277277
"""Test warning when unknown geometries cannot be rendered."""

tests/test_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,9 @@ def test_sub_pixel_read_bad_read_func() -> None:
578578
bounds = (0, 0, 8, 8)
579579

580580
def bad_read_func(
581-
img: np.ndarray, # noqa: ARG001
582-
bounds: IntBounds, # noqa: ARG001
583-
*kwargs: dict, # noqa: ARG001
581+
img: np.ndarray,
582+
bounds: IntBounds,
583+
*kwargs: dict,
584584
) -> None:
585585
"""Dummy function for a failing test."""
586586
return
@@ -740,7 +740,7 @@ def test_sub_pixel_read_incorrect_read_func_return() -> None:
740740
bounds = (0, 0, 8, 8)
741741
image = np.ones((10, 10))
742742

743-
def read_func(*args: tuple, **kwargs: dict) -> np.ndarray: # noqa: ARG001
743+
def read_func(*args: tuple, **kwargs: dict) -> np.ndarray:
744744
"""Dummy read function for tests."""
745745
return np.ones((5, 5))
746746

@@ -759,7 +759,7 @@ def test_sub_pixel_read_empty_read_func_return() -> None:
759759
bounds = (0, 0, 8, 8)
760760
image = np.ones((10, 10))
761761

762-
def read_func(*args: tuple, **kwargs: dict) -> np.ndarray: # noqa: ARG001
762+
def read_func(*args: tuple, **kwargs: dict) -> np.ndarray:
763763
"""Dummy read function for tests."""
764764
return np.ones((0, 0))
765765

tiatoolbox/visualization/bokeh_app/main.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ def __setattr__(
854854

855855
# Define UI callbacks
856856
# region
857-
def res_switch_cb(attr: str, old: int, new: int) -> None: # noqa: ARG001
857+
def res_switch_cb(attr: str, old: int, new: int) -> None:
858858
"""Callback to switch between resolutions."""
859859
if new == 0:
860860
UI["vstate"].res = 1
@@ -864,7 +864,7 @@ def res_switch_cb(attr: str, old: int, new: int) -> None: # noqa: ARG001
864864
UI["vstate"].to_update.update(["overlay", "slide"])
865865

866866

867-
def slide_toggle_cb(attr: str) -> None: # noqa: ARG001
867+
def slide_toggle_cb(attr: str) -> None:
868868
"""Callback to toggle the slide on/off."""
869869
if UI["p"].renderers[0].alpha == 0:
870870
UI["p"].renderers[0].alpha = UI["slide_alpha"].value
@@ -877,7 +877,7 @@ def node_select_cb(attr: str, old: int, new: int) -> None:
877877
# Do something on node select if desired
878878

879879

880-
def overlay_toggle_cb(attr: str) -> None: # noqa: ARG001
880+
def overlay_toggle_cb(attr: str) -> None:
881881
"""Callback to toggle the overlay on/off."""
882882
for i in range(5, len(UI["p"].renderers)):
883883
if UI["p"].renderers[i].alpha == 0:
@@ -935,14 +935,14 @@ def populate_slide_list(slide_folder: Path, search_txt: str | None = None) -> No
935935
UI["slide_select"].options = file_list
936936

937937

938-
def filter_input_cb(attr: str, old: str, new: str) -> None: # noqa: ARG001 # skipcq: PYL-W0613
938+
def filter_input_cb(attr: str, old: str, new: str) -> None: # skipcq: PYL-W0613
939939
"""Change predicate to be used to filter annotations."""
940940
build_predicate()
941941
UI["vstate"].update_state = 1
942942
UI["vstate"].to_update.update(["overlay"])
943943

944944

945-
def cprop_input_cb(attr: str, old: str, new: list[str]) -> None: # noqa: ARG001 # skipcq: PYL-W0613
945+
def cprop_input_cb(attr: str, old: str, new: list[str]) -> None: # skipcq: PYL-W0613
946946
"""Change property to color by."""
947947
if len(new) == 0:
948948
return
@@ -957,30 +957,30 @@ def cprop_input_cb(attr: str, old: str, new: list[str]) -> None: # noqa: ARG001
957957
UI["vstate"].to_update.update(["overlay"])
958958

959959

960-
def slide_alpha_cb(attr: str, old: float, new: float) -> None: # noqa: ARG001
960+
def slide_alpha_cb(attr: str, old: float, new: float) -> None:
961961
"""Callback to change the alpha of the slide."""
962962
UI["p"].renderers[0].alpha = new
963963

964964

965-
def overlay_alpha_cb(attr: str, old: float, new: float) -> None: # noqa: ARG001
965+
def overlay_alpha_cb(attr: str, old: float, new: float) -> None:
966966
"""Callback to change the alpha of all overlay layers."""
967967
for i in range(5, len(UI["p"].renderers)):
968968
UI["p"].renderers[i].alpha = new
969969

970970

971-
def pt_size_cb(attr: str, old: float, new: float) -> None: # noqa: ARG001
971+
def pt_size_cb(attr: str, old: float, new: float) -> None:
972972
"""Callback to change the size of the points."""
973973
UI["vstate"].graph_node.radius = 2 * new
974974

975975

976-
def edge_size_cb(attr: str, old: float, new: float) -> None: # noqa: ARG001
976+
def edge_size_cb(attr: str, old: float, new: float) -> None:
977977
"""Callback to change the size of the edges."""
978978
update_renderer("edge_thickness", new)
979979
UI["vstate"].update_state = 1
980980
UI["vstate"].to_update.update(["overlay"])
981981

982982

983-
def opt_buttons_cb(attr: str, old: list[int], new: list[int]) -> None: # noqa: ARG001
983+
def opt_buttons_cb(attr: str, old: list[int], new: list[int]) -> None:
984984
"""Callback to handle options changes in the ui widget."""
985985
old_thickness = UI["vstate"].thickness
986986
if FILLED in new:
@@ -1008,22 +1008,22 @@ def opt_buttons_cb(attr: str, old: list[int], new: list[int]) -> None: # noqa:
10081008
UI["p"].xgrid.grid_line_alpha = 0
10091009

10101010

1011-
def cmap_select_cb(attr: str, old: str, new: str) -> None: # noqa: ARG001
1011+
def cmap_select_cb(attr: str, old: str, new: str) -> None:
10121012
"""Callback to change the color map."""
10131013
if not (UI["vstate"].is_categorical and new != "dict"):
10141014
update_renderer("mapper", new)
10151015
UI["vstate"].update_state = 1
10161016
UI["vstate"].to_update.update(["overlay"])
10171017

10181018

1019-
def blur_spinner_cb(attr: str, old: float, new: float) -> None: # noqa: ARG001
1019+
def blur_spinner_cb(attr: str, old: float, new: float) -> None:
10201020
"""Callback to change the blur radius."""
10211021
update_renderer("blur_radius", new)
10221022
UI["vstate"].update_state = 1
10231023
UI["vstate"].to_update.update(["overlay"])
10241024

10251025

1026-
def scale_spinner_cb(attr: str, old: float, new: float) -> None: # noqa: ARG001
1026+
def scale_spinner_cb(attr: str, old: float, new: float) -> None:
10271027
"""Callback to change the max scale.
10281028
10291029
This defines a scale above which small annotations are
@@ -1035,7 +1035,7 @@ def scale_spinner_cb(attr: str, old: float, new: float) -> None: # noqa: ARG001
10351035
UI["vstate"].to_update.update(["overlay"])
10361036

10371037

1038-
def slide_select_cb(attr: str, old: str, new: str) -> None: # noqa: ARG001
1038+
def slide_select_cb(attr: str, old: str, new: str) -> None:
10391039
"""Set up the newly chosen slide."""
10401040
if len(new) == 0:
10411041
return
@@ -1200,14 +1200,14 @@ def layer_drop_cb(attr: MenuItemClick) -> None:
12001200
change_tiles(resp)
12011201

12021202

1203-
def layer_select_cb(attr: ButtonClick) -> None: # noqa: ARG001
1203+
def layer_select_cb(attr: ButtonClick) -> None:
12041204
"""Callback to handle toggling specific annotation types on and off."""
12051205
build_predicate()
12061206
UI["vstate"].update_state = 1
12071207
UI["vstate"].to_update.update(["overlay"])
12081208

12091209

1210-
def fixed_layer_select_cb(obj: Button, attr: ButtonClick) -> None: # noqa: ARG001
1210+
def fixed_layer_select_cb(obj: Button, attr: ButtonClick) -> None:
12111211
"""Callback to handle toggling non-annotation layers on and off."""
12121212
key = UI["vstate"].layer_dict[obj.label]
12131213
if obj.label == "edges":
@@ -1231,8 +1231,8 @@ def fixed_layer_select_cb(obj: Button, attr: ButtonClick) -> None: # noqa: ARG0
12311231

12321232
def layer_slider_cb(
12331233
obj: Slider,
1234-
attr: str, # noqa: ARG001
1235-
old: float, # noqa: ARG001
1234+
attr: str,
1235+
old: float,
12361236
new: float,
12371237
) -> None:
12381238
"""Callback to handle changing the alpha of a layer."""
@@ -1251,8 +1251,8 @@ def layer_slider_cb(
12511251

12521252
def color_input_cb(
12531253
obj: ColorPicker,
1254-
attr: str, # noqa: ARG001
1255-
old: str, # noqa: ARG001
1254+
attr: str,
1255+
old: str,
12561256
new: str,
12571257
) -> None:
12581258
"""Callback to handle changing the color of an annotation type."""
@@ -1283,12 +1283,12 @@ def wrapped(attr: ButtonClick) -> None:
12831283
return wrapped
12841284

12851285

1286-
def model_drop_cb(attr: str, old: str, new: str) -> None: # noqa: ARG001
1286+
def model_drop_cb(attr: str, old: str, new: str) -> None:
12871287
"""Callback to handle model selection."""
12881288
UI["vstate"].current_model = new
12891289

12901290

1291-
def to_model_cb(attr: ButtonClick) -> None: # noqa: ARG001
1291+
def to_model_cb(attr: ButtonClick) -> None:
12921292
"""Callback to run currently selected model."""
12931293
if UI["vstate"].current_model == "hovernet":
12941294
segment_on_box()
@@ -1297,7 +1297,7 @@ def to_model_cb(attr: ButtonClick) -> None: # noqa: ARG001
12971297
logger.warning("unknown model")
12981298

12991299

1300-
def type_cmap_cb(attr: str, old: list[str], new: list[str]) -> None: # noqa: ARG001
1300+
def type_cmap_cb(attr: str, old: list[str], new: list[str]) -> None:
13011301
"""Callback to handle changing a type-specific color property."""
13021302
if len(new) == 0:
13031303
# Remove type-specific coloring
@@ -1362,7 +1362,7 @@ def type_cmap_cb(attr: str, old: list[str], new: list[str]) -> None: # noqa: AR
13621362
UI["vstate"].to_update.update(["overlay"])
13631363

13641364

1365-
def save_cb(attr: ButtonClick) -> None: # noqa: ARG001
1365+
def save_cb(attr: ButtonClick) -> None:
13661366
"""Callback to handle saving annotations."""
13671367
save_path = make_safe_name(
13681368
str(
@@ -2132,7 +2132,7 @@ def update() -> None:
21322132
UI["vstate"].update_state = DO_UPDATE
21332133

21342134

2135-
def control_tabs_cb(attr: str, old: int, new: int) -> None: # noqa: ARG001
2135+
def control_tabs_cb(attr: str, old: int, new: int) -> None:
21362136
"""Callback to handle selecting active window."""
21372137
if new == 1 and len(slide_wins.children) == 1:
21382138
# Make new window
@@ -2154,8 +2154,8 @@ def control_tabs_cb(attr: str, old: int, new: int) -> None: # noqa: ARG001
21542154

21552155

21562156
def control_tabs_remove_cb(
2157-
attr: str, # noqa: ARG001
2158-
old: list[int], # noqa: ARG001
2157+
attr: str,
2158+
old: list[int],
21592159
new: list[int],
21602160
) -> None:
21612161
"""Callback to handle removing a window."""

0 commit comments

Comments
 (0)