Skip to content

Commit 557bda5

Browse files
authored
Merge branch 'develop' into dev-define-engines-abc
2 parents 01e2262 + 621a857 commit 557bda5

File tree

6 files changed

+21
-4
lines changed

6 files changed

+21
-4
lines changed

.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.4.9 pytest pytest-cov pytest-runner
33+
python -m pip install ruff==0.4.10 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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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.4.9
63+
rev: v0.4.10
6464
hooks:
6565
- id: ruff
6666
args: [--fix, --exit-non-zero-on-fix]

requirements/requirements_dev.txt

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

tests/test_annotation_stores.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
Polygon,
2828
)
2929

30+
from tiatoolbox import logger
3031
from tiatoolbox.annotation import (
3132
Annotation,
3233
AnnotationStore,
@@ -52,6 +53,14 @@
5253
FILLED_LEN = 2 * (GRID_SIZE[0] * GRID_SIZE[1])
5354
RNG = np.random.default_rng(0) # Numpy Random Generator
5455

56+
# ----------------------------------------------------------------------
57+
# Resets
58+
# ----------------------------------------------------------------------
59+
60+
# Reset filters in logger.
61+
for filter_ in logger.filters:
62+
logger.removeFilter(filter_)
63+
5564
# ----------------------------------------------------------------------
5665
# Helper Functions
5766
# ----------------------------------------------------------------------

tests/test_init.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ def test_logger_output() -> None:
109109

110110
def test_duplicate_filter(caplog: pytest.LogCaptureFixture) -> None:
111111
"""Test DuplicateFilter for warnings."""
112+
# Test logger reset after applying duplicate filter.
113+
duplicate_filter = DuplicateFilter()
114+
logger.addFilter(duplicate_filter)
115+
116+
# Reset filters in logger.
117+
for filter_ in logger.filters:
118+
logger.removeFilter(filter_)
119+
112120
for _ in range(2):
113121
logger.warning("Test duplicate filter warnings.")
114122
assert "Test duplicate filter warnings." in caplog.text

tiatoolbox/annotation/storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ def patch_many(
814814
geometries = geometries or (None for _ in keys) # pragma: no branch
815815
# Update the store
816816
for key, geometry, properties in zip(keys, geometries, properties_iter):
817-
properties_ = copy.deepcopy(properties)
817+
properties_ = cast(dict[str, Any], copy.deepcopy(properties))
818818
self.patch(key, geometry, properties_)
819819

820820
def remove(self: AnnotationStore, key: str) -> None:

0 commit comments

Comments
 (0)