Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/mypy-type-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ jobs:
tiatoolbox/models/__init__.py \
tiatoolbox/models/models_abc.py \
tiatoolbox/models/architecture/__init__.py \
tiatoolbox/models/architecture/utils.py \
tiatoolbox/models/architecture/utils.py
2 changes: 1 addition & 1 deletion requirements/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-r ../docs/requirements.txt
coverage>=7.0.0
docutils>=0.18.1
mypy>=1.6.1
mypy>=1.16
pip>=22.3
poetry-bumpversion>=0.3.1
pre-commit>=2.20.0
Expand Down
10 changes: 7 additions & 3 deletions tiatoolbox/tools/pyramid.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import zipfile
from io import BytesIO
from pathlib import Path
from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Literal

import defusedxml
import numpy as np
Expand Down Expand Up @@ -352,7 +352,9 @@ def save_tile(tile_path: Path, tile: Image.Image) -> None:
)

else: # container == "tar":
compression2mode = {
compression2mode: dict[
str | None, Literal["w", "w:gz", "w:bz2", "w:xz"]
] = {
None: "w",
"gzip": "w:gz",
"bz2": "w:bz2",
Expand All @@ -362,7 +364,9 @@ def save_tile(tile_path: Path, tile: Image.Image) -> None:
msg = "Unsupported compression for tar."
raise ValueError(msg)

tar_archive = tarfile.TarFile.open(path, mode=compression2mode[compression])
tar_archive = tarfile.TarFile.open(
str(path), mode=compression2mode[compression]
)

def save_tile(tile_path: Path, tile: Image.Image) -> None:
"""Write the tile to the output zip."""
Expand Down
Loading