Skip to content

Commit 0efc25b

Browse files
committed
Narrow some ImageSlide property types
ImageSlide is hardcoded to a single level, and the level_count property and get_best_level_for_downsample() return types already reflect this. Reduce the level_dimensions() and level_downsamples() return types to 1-tuples. In the latter case we can't reduce to a Literal because literal floats are disallowed. Signed-off-by: Benjamin Gilbert <[email protected]>
1 parent f1d02fc commit 0efc25b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

openslide/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ def level_count(self) -> Literal[1]:
402402
return 1
403403

404404
@property
405-
def level_dimensions(self) -> tuple[tuple[int, int], ...]:
405+
def level_dimensions(self) -> tuple[tuple[int, int]]:
406406
"""A list of (width, height) tuples, one for each level of the image.
407407
408408
level_dimensions[n] contains the dimensions of level n."""
@@ -411,7 +411,7 @@ def level_dimensions(self) -> tuple[tuple[int, int], ...]:
411411
return (self._image.size,)
412412

413413
@property
414-
def level_downsamples(self) -> tuple[float, ...]:
414+
def level_downsamples(self) -> tuple[float]:
415415
"""A list of downsampling factors for each level of the image.
416416
417417
level_downsample[n] contains the downsample factor of level n."""

0 commit comments

Comments
 (0)