Skip to content

🔖 Release 2.1.3 - #1097

Merged
shaneahmed merged 802 commits into
masterfrom
pre-release
Jul 21, 2026
Merged

shaneahmed merged 802 commits into
masterfrom
pre-release

Conversation

@shaneahmed

Copy link
Copy Markdown
Member

TIAToolbox v2.1.3 (2026-07-21)

🐞 Bug Fixes and Other Changes

🛠️ Development-Related Changes

shaneahmed and others added 30 commits August 23, 2023 12:22
- Fix `flake8-annotations` for `wsicore`
- 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.
- Fix `flake8-annotations` Checks in `models`
- 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-->
Fix #710 

Fix the situation where PatchExtractor.get_coords() can return patch coords which lie fully outside the bounds of a slide.

- Adds a test that would flag this situation.
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>
- Add `mypy` Checks to `exceptions.py`
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>
shaneahmed and others added 21 commits June 8, 2026 13:47
- 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
* ♻️ Refactor `wsireader`
- This PR is in preparation to break down `wsireader` for easier management of readers in the future.

* 📝 Use American English

* ⏪ Revert changes to `requirements.txt`

* 📝 Use American spellings for "optimize"
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
@shaneahmed shaneahmed self-assigned this Jul 21, 2026
@shaneahmed shaneahmed added this to the Release v2.1.3 milestone Jul 21, 2026
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.88%. Comparing base (75f67ca) to head (7a94e28).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shaneahmed
shaneahmed merged commit 0d1495f into master Jul 21, 2026
42 checks passed
@shaneahmed
shaneahmed deleted the pre-release branch July 21, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.