🔖 Release 2.1.3 - #1097
Merged
Merged
🔖 Release 2.1.3#1097
Conversation
- Add `flake8-annotations` Checks for `engine`
Adds the ability to run tests using several workers using [pytest-xdist](https://github.com/pytest-dev/pytest-xdist), significantly improving processing time. For example, on M1 Max (no CUDA), processing time dropped **from 14 minutes to 4 minutes 💨💨💨.** <img width="1614" alt="image" src="https://github.com/TissueImageAnalytics/tiatoolbox/assets/19199204/fbb607b0-3bf1-48c3-b14a-be4acf2b1ec3"> However, this optimization comes at a cost. Previously, tests depended on serial execution. For example, segmentation and prediction methods used to rely on "output" as a folder to store intermediate results. If many functions modified this folder at the same time, the result would be unpredictable. To address this, I made some tweaks alongside #641 and #673 so that functions will not depend on each other. If we merge this pull request, we will need to start checking that new tests are ready for parallel execution. **Depends on #641 and #673
- Fixes PatchExtractors `within_bound ` has an incorrect description.
- Upgrade `ruff` to version `0.0.286`
updates: - [github.com/executablebooks/mdformat: 0.7.16 → 0.7.17](hukkin/mdformat@0.7.16...0.7.17) - [github.com/astral-sh/ruff-pre-commit: v0.0.285 → v0.0.286](astral-sh/ruff-pre-commit@v0.0.285...v0.0.286) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Add `flake8-annotations` Checks to `pre-commit` and `conftest.py` - Add `flake8-annotations` Checks to `conftest.py` - Add `flake8-annotations` Checks to `tests\models`
- Fix Add `flake8-annotations` checks for `enums.py` - Fix Add `flake8-annotations` checks for `test_graph.py` - Fix Add `flake8-annotations` checks for `test_patch_extraction.py` - Fix Add `flake8-annotations` checks for `test_pyramid.py` - Fix Add `flake8-annotations` checks for `tests/test_save_tiles.py ` - Fix Add `flake8-annotations` checks for `tests/test_slide_thumbnail.py` and `tests/test_slide_info.py` - Fix Add `flake8-annotations` checks for `tests/test_stainnorm.py` and `tests/test_stainaugment.py` - Fix Add `flake8-annotations` checks for `tests/test_utils.py` - Fix Add `flake8-annotations` checks for `tests/test_tissuemask.py` and `tests/test_tiffreader.py` - Fix `tests/test_tileserver.py` - Fix `flake8-annotations` for test_wsi_registration.py - Fix `flake8-annotations` for test_docs.py - Fix `flake8-annotations` for test_wsireader.py
- Add `IOConfig` for NuClick in `pretrained_model.yaml`
<!--pre-commit.ci start--> updates: - [github.com/psf/black: 23.7.0 → 23.9.1](psf/black@23.7.0...23.9.1) - [github.com/astral-sh/ruff-pre-commit: v0.0.286 → v0.0.288](astral-sh/ruff-pre-commit@v0.0.286...v0.0.288) <!--pre-commit.ci end-->
updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.288 → v0.0.290](astral-sh/ruff-pre-commit@v0.0.288...v0.0.290) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Fix flake8-annotation errors in tests and annotation. --------- Co-authored-by: Abdol A <u2271662@live.warwick.ac.uk> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.290 → v0.0.291](astral-sh/ruff-pre-commit@v0.0.290...v0.0.291) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Add `ruff` checks with selected options. --------- Signed-off-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: John Pocock <John-P@users.noreply.github.com>
updates: - [github.com/astral-sh/ruff-pre-commit: v0.0.291 → v0.0.292](astral-sh/ruff-pre-commit@v0.0.291...v0.0.292) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Update minimum requirement for torch to `2.1.0`
updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](pre-commit/pre-commit-hooks@v4.4.0...v4.5.0) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Adds a function `patch_pred_store` to convert the output from `PatchPredictor` into an `AnnotationStore`. --------- Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
- Add type checking using `mypy`, a static type checker for Python. - A GitHub action has been created to run `mypy` after push and pull requests. - Currently, only `tiatoolbox/__init__.py` has been checked to work without errors with `mypy`. --------- Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
updates: - [github.com/psf/black: 23.9.1 → 23.10.0](psf/black@23.9.1...23.10.0) - [github.com/astral-sh/ruff-pre-commit: v0.0.292 → v0.1.1](astral-sh/ruff-pre-commit@v0.0.292...v0.1.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Adds functions to save the TIAToolbox Engine outputs to Zarr and AnnotationStore files. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
updates: - [github.com/psf/black: 23.10.0 → 23.10.1](psf/black@23.10.0...23.10.1) - [github.com/astral-sh/ruff-pre-commit: v0.1.1 → v0.1.3](astral-sh/ruff-pre-commit@v0.1.1...v0.1.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Add typehints for dataset_abc.py - Fix `rcParam` - Fix pyproject.toml format --------- Co-authored-by: Dmitrii Blaginin <blaginin@mbp-2.local> Co-authored-by: Dmitrii Blaginin <blaginin@mbp.lan> Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
updates: - [github.com/astral-sh/ruff-pre-commit: v0.1.3 → v0.1.4](astral-sh/ruff-pre-commit@v0.1.3...v0.1.4) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Fixes issue #735 --------- Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
-Add `mypy` checks to `tiatoolbox/typing.py` and `tiatoolbox/utils/env_detection.py` --------- Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
updates: - [github.com/psf/black: 23.10.1 → 23.11.0](psf/black@23.10.1...23.11.0) - [github.com/astral-sh/ruff-pre-commit: v0.1.4 → v0.1.5](astral-sh/ruff-pre-commit@v0.1.4...v0.1.5) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Update `mamba-org/setup-micromamba` `checkout`
- Fixing an issue on - Windows urlparse converts the input to str causing WSI reading to fail - Fix s3 links to test cloud ngff read
…ector` (#1074) Follow-up to the earlier multi-GPU fix. kongnet and nucleus_detector were missed and still crash on multi-GPU machines with: AttributeError: 'DataParallel' object has no attribute 'target_channels' When multi-gpu, the model is wrapped in `nn.DataParallel` / `DistributedDataParallel`, so these need to go through **the `_get_model_attr()` wrapper helper function** (or a similar approach) which unwraps the module before reading the attribute. ### Changes - `nucleus_detector.py`: read `min_distance` / `tile_shape` via the `_get_model_attr` helper instead of directly off `self.model`. - `kongnet.py`: unwrap the module before reading `target_channels` in `infer_batch`. This can't reach the helper function, so it applies the same unwrap inline. - `engine_abc.py`: simplify _get_model_attr to a single getattr-based unwrap and clarify its docstring. --- Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
Fixes a bug in MultiTaskSegmentor’s WSI probability-map vertical merging when spilling intermediate probability rows to Zarr. Previously, once a head spilled to Zarr, subsequent chunks for that same head could continue accumulating in memory instead of being appended to the Zarr. At finalization, the code preferred the Zarr array and discarded the in-memory chunks, producing truncated probability maps for only the heads that spilled resulting in the shape mismatch that was being seen by me and Jiaqi. The fix keeps hold of the opened Zarr group after the first spill and routes later chunks for that head into the same Zarr dataset. This preserves the full merged probability-map height across all heads. --------- Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
## TIAToolbox v2.1.1 (2026-06-10) ### 🐞 Bug Fixes and Other Changes - Fix errors while running engines on an `mps` device (#1073) - Fix `pre-trained.yaml` typos and errors (#1069) - Fix WSI reading on Windows (#1076) - Fix `multi-gpu` run error (#1074) - Fix broken margin behaviour while generating output using semantic segmentor and multi-task segmentor (#1067). ### 🛠️ Development-Related Changes - Add and update Python 3.14 docker image (#1066) - Pin `sphinx>=9.0.0` (#1050) - Update `ruff` versions to `0.15.15` (#1072) - Update `conda-resolve` workflow (#1077)
- Add albucore dependency - Update `matplotlib` and fix bugs
- Fix JSON output for semantic segmentation
## TIAToolbox v2.1.2 (2026-06-12) ### 🐞 Bug Fixes and Other Changes - Fix errors due to changes in matplotlib colormaps API (#1081) - Fix semantic segmentor JSON output (#1082) ### 🛠️ Development-Related Changes - Add `albucore` dependency for conda build (#1081) - Update minimum requirement for `matplotlib` to `3.10.0`
* 🐛 Fix DFBR feature mapping test * ✅ Add test for estimating affine transform * ✅ Add test where after_dice > before_dice
* 🔥 Remove `albumentations` dependencies * 🔥 Remove `albumentations` dependencies * ✅ Add tests for coverage * ✅ Add tests for coverage * 🐛 Fix deepsource error
Cap zarr<3.2.0 tifffile>=2026.6.1 forces Python>=3.12, breaking CI on Python 3.9-3.11. The actual bug (ImportError: cannot import name 'RegularChunkGrid' from zarr.core.chunk_grids) is caused by zarr 3.2.x moving that internal class, not by tifffile's version. Capping zarr<3.2.0 avoids the incompatible internal API without constraining the Python versions tiatoolbox supports. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: Your Name <you@example.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
* 🧑💻 pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.15.15 → v0.15.20](astral-sh/ruff-pre-commit@v0.15.15...v0.15.20) * 📌 Update `ruff` version to `0.15.20` --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Shan E Ahmed Raza <13048456+shaneahmed@users.noreply.github.com>
- Remove unnecessary workflows on push
* 🐛 Fix padded contours for Visualization - This commit fixes visualization of contour overlays with padded values. - padded values were introduced to make the contours rectangular in an effort to make np arrays compatible with zarr v3 * 🐛 Fix dtype if input is not np array
…entor` CLI (#1089) * fix: handle None return_predictions in multi_task_segmentor When CLI passes return_predictions=None, any() crashes on line 1972. Added 'or (False,)' to safely default to (False,) when None is passed. Fixes nucleus instance segmentor AnnotationStore output via CLI.
# Conflicts: # .github/workflows/conda-env-create.yml # .github/workflows/mypy-type-check.yml # .github/workflows/pip-install.yml # .github/workflows/python-package.yml # .pre-commit-config.yaml # examples/01-wsi-reading.ipynb # examples/02-stain-normalization.ipynb # examples/03-tissue-masking.ipynb # examples/04-patch-extraction.ipynb # examples/05-patch-prediction.ipynb # examples/06-semantic-segmentation.ipynb # examples/07-advanced-modeling.ipynb # examples/08-nucleus-instance-segmentation.ipynb # examples/09-multi-task-segmentation.ipynb # examples/10-wsi-registration.ipynb # examples/11-import-foundation-models.ipynb # examples/12-nucleus-detection.ipynb # examples/inference-pipelines/idars.ipynb # examples/inference-pipelines/slide-graph.ipynb # requirements/requirements.txt # requirements/requirements_dev.txt # tests/engines/test_nucleus_instance_segmentor.py # tests/test_stainaugment.py # tests/test_tiffreader.py # tests/test_utils.py # tests/test_wsi_registration.py # tests/test_wsireader.py # tiatoolbox/cli/nucleus_instance_segment.py # tiatoolbox/models/engine/multi_task_segmentor.py # tiatoolbox/tools/pyramid.py # tiatoolbox/tools/registration/wsi_registration.py # tiatoolbox/tools/stainaugment.py # tiatoolbox/utils/misc.py # tiatoolbox/utils/transforms.py # tiatoolbox/utils/visualization.py # tiatoolbox/visualization/tileserver.py # tiatoolbox/wsicore/__init__.py # tiatoolbox/wsicore/wsireader.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1097 +/- ##
=======================================
Coverage 99.88% 99.88%
=======================================
Files 85 86 +1
Lines 11659 11676 +17
Branches 1530 1533 +3
=======================================
+ Hits 11646 11663 +17
Misses 7 7
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TIAToolbox v2.1.3 (2026-07-21)
🐞 Bug Fixes and Other Changes
Nonereturn_predictionsinNucleusInstanceSegmentorCLI (🐛 Fix handling ofNonereturn_predictionsinNucleusInstanceSegmentorCLI #1089), contributed by @Anannya30🛠️ Development-Related Changes
albumentationsdependencies (🔥 RemovealbumentationsDependencies #1086)albumentationsxhas incompatible license. Therefore, we do not plan to include this in future release.wsireader♻️ Refactorwsireader#1088wsireaderwill be restructured for maintainability in future releases without breaking changes to the API.tifffileandzarrmin versions on Colab (🐛 Fixtifffileandzarrmin versions onColab#1091)3.11will be dropped in future releases for compatibility with latest releases ofzarr.push#1094)