Skip to content

Commit 6c6bceb

Browse files
committed
💡 Address @Copilot comments
1 parent 5b0d6d5 commit 6c6bceb

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

tests/models/test_dataset.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,3 +540,23 @@ def __getitem__(self: Proto, idx: int) -> None:
540540
# test assign uncallable to preproc_func/postproc_func
541541
with pytest.raises(ValueError, match=r".*callable*"):
542542
ds.preproc_func = 1 # skipcq: PYL-W0201
543+
544+
545+
def test_none_patch_input_shape(sample_svs: Path) -> None:
546+
"""Test for None patch input shape."""
547+
with pytest.raises(ValueError, match=r".*`patch_input_shape` must be specified.*"):
548+
WSIPatchDataset(
549+
img_path=sample_svs,
550+
stride_shape=(256, 256),
551+
auto_get_mask=False,
552+
)
553+
554+
555+
def test_none_stride_shape_shape(sample_svs: Path) -> None:
556+
"""Test for None stride shape."""
557+
with pytest.raises(ValueError, match=r".*`stride_shape` must be specified.*"):
558+
WSIPatchDataset(
559+
img_path=sample_svs,
560+
patch_input_shape=(256, 256),
561+
auto_get_mask=False,
562+
)

tiatoolbox/models/engine/engine_abc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ def _update_run_params(
10101010
for key in kwargs:
10111011
setattr(self, key, kwargs.get(key))
10121012

1013-
if self.num_workers is not None and self.num_workers > 0:
1013+
if self.num_workers > 0:
10141014
dask.config.set(scheduler="threads", num_workers=self.num_workers)
10151015
else:
10161016
dask.config.set(scheduler="threads")

tiatoolbox/models/engine/semantic_segmentor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def infer_wsi(
436436
tqdm_loop = (
437437
tqdm(dataloader, leave=False, desc="Inferring patches")
438438
if self.verbose
439-
else self.dataloader
439+
else dataloader
440440
)
441441

442442
canvas_np, output_locs_y_ = None, None

0 commit comments

Comments
 (0)