Skip to content

Commit 16a632f

Browse files
authored
Merge branch 'dev-define-engines-abc' into dev-define-semantic-segmentor
2 parents c84099b + 8571e14 commit 16a632f

28 files changed

+39
-41
lines changed

.github/workflows/mypy-type-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
mypy --install-types --non-interactive --follow-imports=skip \
4141
tiatoolbox/__init__.py \
4242
tiatoolbox/__main__.py \
43-
tiatoolbox/typing.py \
43+
tiatoolbox/type_hints.py \
4444
tiatoolbox/tiatoolbox.py \
4545
tiatoolbox/utils \
4646
tiatoolbox/tools \

.github/workflows/python-package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
sudo apt update
3131
sudo apt-get install -y libopenslide-dev openslide-tools libopenjp2-7 libopenjp2-tools
3232
python -m pip install --upgrade pip
33-
python -m pip install ruff==0.8.2 pytest pytest-cov pytest-runner
33+
python -m pip install ruff==0.9.4 pytest pytest-cov pytest-runner
3434
pip install -r requirements/requirements.txt
3535
- name: Cache tiatoolbox static assets
3636
uses: actions/cache@v3

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
- mdformat-black
2424
- mdformat-myst
2525
- repo: https://github.com/executablebooks/mdformat
26-
rev: 0.7.21
26+
rev: 0.7.22
2727
hooks:
2828
- id: mdformat
2929
# Optionally add plugins
@@ -60,7 +60,7 @@ repos:
6060
- id: rst-inline-touching-normal # Detect mistake of inline code touching normal text in rst.
6161
- repo: https://github.com/astral-sh/ruff-pre-commit
6262
# Ruff version.
63-
rev: v0.8.6
63+
rev: v0.9.4
6464
hooks:
6565
- id: ruff
6666
args: [--fix, --exit-non-zero-on-fix]

pre-commit/notebook_urls.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ def check_notebook(
197197
for line_num, line in enumerate(cell["source"]):
198198
new_line = replace_line(line, to_ref, replacements)
199199
if new_line != line:
200-
print(f"{path.name}: Changed (cell {cell_num+1}, line {line_num+1})")
200+
print(
201+
f"{path.name}: Changed (cell {cell_num + 1}, line {line_num + 1})"
202+
)
201203
changed = True
202204
cell["source"][line_num] = new_line
203205
return changed, notebook

requirements/requirements_dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pytest>=7.2.0
1010
pytest-cov>=4.0.0
1111
pytest-runner>=6.0
1212
pytest-xdist[psutil]
13-
ruff==0.8.2 # This will be updated by pre-commit bot to latest version
13+
ruff==0.9.4 # This will be updated by pre-commit bot to latest version
1414
toml>=0.10.2
1515
twine>=4.0.1
1616
wheel>=0.37.1

tests/engines/test_engine_abc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def test_engine_run() -> NoReturn:
355355

356356
def test_engine_run_with_verbose() -> NoReturn:
357357
"""Test engine run with verbose."""
358-
"""Run pytest with `-rP` option to view progress bar on the captured stderr call"""
358+
# Run pytest with `-rP` option to view progress bar on the captured stderr call.
359359

360360
eng = TestEngineABC(model="alexnet-kather100k", verbose=True)
361361
out = eng.run(
@@ -401,7 +401,7 @@ def test_patch_pred_zarr_store(tmp_path: pytest.TempPathFactory) -> NoReturn:
401401
)
402402
assert Path.exists(out), "Zarr output file does not exist"
403403

404-
""" test custom zarr output file name"""
404+
# Test custom zarr output file name
405405
eng = TestEngineABC(model="alexnet-kather100k")
406406
out = eng.run(
407407
images=np.zeros((10, 224, 224, 3), dtype=np.uint8),

tests/models/test_models_abc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def forward(self: Proto) -> None:
7070
# skipcq
7171
def infer_batch() -> None:
7272
"""Define infer batch."""
73-
pass # base class definition pass # noqa: PIE790
7473

7574

7675
@pytest.mark.skipif(

tests/test_annotation_stores.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
if TYPE_CHECKING: # pragma: no cover
4141
from numbers import Number
4242

43-
from tiatoolbox.typing import Geometry
43+
from tiatoolbox.type_hints import Geometry
4444

4545

4646
sqlite3.enable_callback_tracebacks(True) # noqa: FBT003

tests/test_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def raise_source_exception(
141141
for n, line in enumerate(source.splitlines())
142142
]
143143
if source_offset:
144-
source_lines.insert(source_lineno, f"{' '*(source_offset+3)}^ {message}")
144+
source_lines.insert(source_lineno, f"{' ' * (source_offset + 3)}^ {message}")
145145
annotated_source = "\n".join(source_lines)
146146
exception = type(exception) if exception else SyntaxError
147147
msg = f"{rel_path}:{file_lineno}: {message}\n{annotated_source}"

tests/test_patch_extraction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
)
2222

2323
if TYPE_CHECKING:
24-
from tiatoolbox.typing import IntPair, Resolution, Units
24+
from tiatoolbox.type_hints import IntPair, Resolution, Units
2525

2626

2727
def read_points_patches(

0 commit comments

Comments
 (0)