Skip to content

Commit bba59ba

Browse files
shaneahmedpre-commit-ci[bot]mostafajahanifarJohn-PDavidBAEpstein
authored
🔖 Release 1.5.0 (#757)
## 1.5.0 (2023-12-15) ### Major Updates and Feature Improvements - Adds the bokeh visualization tool. #684 - The tool allows a user to launch a server on their machine to visualise whole slide images, overlay the results of deep learning algorithms or to select a patch from whole slide image and run TIAToolbox deep learning engines. - This tool powers the TIA demos server. For details please see https://tiademos.dcs.warwick.ac.uk/. - Extends Annotation to Support Init from WKB #639 - Adds `IOConfig` for NuClick in `pretrained_model.yaml` #709 - Adds functions to save the TIAToolbox Engine outputs to Zarr and AnnotationStore files. #724 - Adds Support for QuPath Annotation Imports #721 ### Changes to API - Adds `model.to(device)` and `model.load_model_from_file()` functionality to make it compatible with PyTorch API. #733 - Replaces `pretrained` with `weights` to make the engines compatible with the new PyTorch API. #621 - Adds support for high-level imports for various utility functions and classes such as `WSIReader`, `PatchPredictor` and `imread` #606, #607, - Adds `tiatoolbox.typing` for type hints. #619 - Fixes incorrect file size saved by `save_tiles`, issue with certain WSIs raised by @TomastpPereira - TissueMasker transform now returns mask instead of a list. #748 - Fixes #732 ### Bug Fixes and Other Changes - Fixes `pixman` incompability error on Colab #601 - Removes `shapely.speedups`. The module no longer has any affect in Shapely >=2.0. #622 - Fixes errors in the slidegraph example notebook #608 - Fixes bugs in WSI Registration #645, #670, #693 - Fixes the situation where PatchExtractor.get_coords() can return patch coords which lie fully outside the bounds of a slide. #712 - Fixes #710 - Fixes #738 raised by @xiachenrui ### Development related changes - Replaces `flake8` and `isort` with `ruff` #625, #666 - Adds `mypy` checks to `root` and `utils` package. This will be rolled out in phases to other modules. #723 - Adds a module to detect file types using magic number/signatures #616 - Uses `poetry` for version updates instead of `bump2version`. #638 - Removes `setup.cfg` and uses `pyproject.toml` for project configurations. - Reduces runtime for some unit tests e.g., #627, #630, #631, #629 - Reuses models and datasets in tests on GitHub actions by utilising cache #641, #644 - Set up parallel tests locally #671 **Full Changelog:** v1.4.0...v1.5.0 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: mostafajahanifar <[email protected]> Co-authored-by: John Pocock <[email protected]> Co-authored-by: DavidBAEpstein <[email protected]> Co-authored-by: David Epstein <[email protected]> Co-authored-by: Ruqayya Awan <[email protected]> Co-authored-by: Mark Eastwood <[email protected]> Co-authored-by: adamshephard <[email protected]> Co-authored-by: adamshephard <[email protected]> Co-authored-by: Abdol <[email protected]> Co-authored-by: Jiaqi-Lv <[email protected]> Co-authored-by: Abishek <[email protected]> Co-authored-by: Dmitrii Blaginin <[email protected]>
1 parent 51f504b commit bba59ba

File tree

171 files changed

+37182
-25466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+37182
-25466
lines changed

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env:
66
REGISTRY: ghcr.io
77
IMAGE_NAME: TissueImageAnalytics/tiatoolbox
88
image: ghcr.io/tissueimageanalytics/tiatoolbox
9-
TOOLBOX_VER: 1.4.1
9+
TOOLBOX_VER: 1.5.0
1010

1111
jobs:
1212
build-and-push-image:
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow will perform code type checking using mypy
2+
3+
name: mypy type checking
4+
5+
on:
6+
push:
7+
branches: [ develop, pre-release, master, main ]
8+
pull_request:
9+
branches: [ develop, pre-release, master, main ]
10+
11+
jobs:
12+
13+
build:
14+
15+
runs-on: ubuntu-22.04
16+
17+
strategy:
18+
matrix:
19+
python-version: ["3.8", "3.9", "3.10", "3.11"]
20+
21+
steps:
22+
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v3
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Checkout repository
29+
uses: actions/checkout@v3
30+
31+
- name: Setup mypy
32+
run: |
33+
pip install mypy
34+
35+
- name: Perform type checking
36+
run: |
37+
mypy --install-types --non-interactive --follow-imports=skip \
38+
tiatoolbox/__init__.py \
39+
tiatoolbox/__main__.py \
40+
tiatoolbox/typing.py \
41+
tiatoolbox/tiatoolbox.py \
42+
tiatoolbox/utils/*.py

.github/workflows/python-package.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ 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 flake8 pytest pytest-cov pytest-runner
33+
python -m pip install ruff==0.0.286 pytest pytest-cov pytest-runner
3434
pip install -r requirements/requirements.txt
35+
- name: Cache tiatoolbox static assets
36+
uses: actions/cache@v3
37+
with:
38+
key: tiatoolbox-home-static
39+
path: ~/.tiatoolbox
3540
- name: Print Version Information
3641
run: |
3742
echo "---SQlite---"
@@ -46,12 +51,10 @@ jobs:
4651
python -c "import sqlite3; print('SQLite %s' % sqlite3.sqlite_version)"
4752
python -c "import numpy; print('Numpy %s' % numpy.__version__)"
4853
python -c "import openslide; print('OpenSlide %s' % openslide.__version__)"
49-
- name: Lint with flake8
54+
- name: Lint with ruff
5055
run: |
5156
# stop the build if there are Python syntax errors or undefined names
52-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
53-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
54-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
57+
ruff check .
5558
- name: Test with pytest
5659
run: |
5760
pytest --basetemp={envtmpdir} \

.pre-commit-config.yaml

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ repos:
1212
require_serial: true
1313
language: system
1414
stages: [push]
15-
- id: notebook-check-ast
16-
name: check notebook ast
17-
entry: python pre-commit/notebook_check_ast.py
18-
types_or: [jupyter]
19-
language: python
2015
- id: notebook-markdown-format
2116
name: notebook markdown format
2217
entry: python pre-commit/notebook_markdown_format.py
@@ -28,15 +23,15 @@ repos:
2823
- mdformat-black
2924
- mdformat-myst
3025
- repo: https://github.com/executablebooks/mdformat
31-
rev: 0.7.16
26+
rev: 0.7.17
3227
hooks:
3328
- id: mdformat
3429
# Optionally add plugins
3530
additional_dependencies:
3631
- mdformat-gfm # GitHub flavoured markdown
3732
- mdformat-black # Black formatting for python verbatim blocks
3833
- repo: https://github.com/pre-commit/pre-commit-hooks
39-
rev: v4.4.0
34+
rev: v4.5.0
4035
hooks:
4136
- id: check-ast # Simply checks whether the files parse as valid Python.
4237
- id: fix-byte-order-marker # Removes utf-8 byte order marker.
@@ -52,49 +47,29 @@ repos:
5247
- id: mixed-line-ending # Replaces or checks mixed line endings.
5348
- id: requirements-txt-fixer # Sorts entries in requirements.txt.
5449
- id: trailing-whitespace # Trims trailing whitespace.
55-
exclude: 'setup.cfg'
5650
- id: file-contents-sorter # Sorts the lines in specified files (defaults to alphabetical).
5751
files: whitelist.txt
5852
- id: debug-statements # Checks for debugger imports and py37+ `breakpoint()` calls in python source.
5953
- id: pretty-format-json # Sets a standard for formatting JSON files.
54+
exclude_types: [jupyter]
6055
- repo: https://github.com/pre-commit/pygrep-hooks
6156
rev: v1.10.0
6257
hooks:
6358
- id: rst-backticks # Detect common mistake of using single backticks when writing rst.
6459
- id: rst-directive-colons # Detect mistake of rst directive not ending with double colon.
6560
- id: rst-inline-touching-normal # Detect mistake of inline code touching normal text in rst.
66-
- repo: https://github.com/pycqa/isort
67-
rev: 5.12.0
68-
hooks:
69-
- id: isort
7061
- repo: https://github.com/psf/black
71-
rev: 23.3.0 # Replace with any tag/version: https://github.com/psf/black/tags
62+
rev: 23.11.0 # Replace with any tag/version: https://github.com/psf/black/tags
7263
hooks:
7364
- id: black
7465
language_version: python3 # Should be a command that runs python3.+
7566
additional_dependencies: ['click==8.0.4'] # Currently >8.0.4 breaks black
7667
- id: black-jupyter
7768
language: python
78-
- repo: https://github.com/PyCQA/flake8
79-
rev: 5.0.4
69+
- repo: https://github.com/astral-sh/ruff-pre-commit
70+
# Ruff version.
71+
rev: v0.1.7
8072
hooks:
81-
- id: flake8
82-
additional_dependencies: [
83-
flake8-bugbear, # Detect potential bugs
84-
flake8-builtins, # Check for built-ins being used as variables
85-
flake8-cognitive-complexity, # Check max function complexity
86-
flake8-comprehensions, # Suggestions for better list/set/dict comprehensions
87-
flake8-eradicate, # Find dead/commented out code
88-
flake8-expression-complexity, # Check max expression complexity
89-
flake8-fixme, # Check for FIXME, TODO, and XXX left in comments
90-
flake8-isort, # Check import ordering
91-
flake8-logging-format, # Validate (lack of) logging format strings
92-
flake8-mutable, # Check for mutable default arguments
93-
flake8-pie, # Misc. linting rules
94-
flake8-pytest-style, # Check against pytest style guide
95-
flake8-return, # Check return statements
96-
flake8-simplify, # Suggestions to simplify code
97-
flake8-spellcheck, # Spelling checker
98-
flake8-use-fstring, # Encourages use of f-strings vs old style
99-
pep8-naming, # Check PEP8 class naming
100-
]
73+
- id: ruff
74+
args: [--fix, --exit-non-zero-on-fix]
75+
types_or: [python, pyi, jupyter]

AUTHORS.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,19 @@
55
- TIA Centre led by Nasir Rajpoot <[email protected]>
66
- Shan E Ahmed Raza \<@shaneahmed>
77
- John Pocock \<@John-P>
8+
- Mark Eastwood \<@measty>
89
- Simon Graham \<@simongraham>
910
- Dang Vu \<@vqdang>
1011
- Mostafa Jahanifar \<@mostafajahanifar>
1112
- David Epstein \<@DavidBAEpstein>
12-
- Mark Eastwood \<@measty>
13-
- Srijay Deshpande \<@Srijay-lab>
14-
- Ruqayya Awan \<@ruqayya>
1513
- Adam Shephard \<@adamshephard>
14+
- Ruqayya Awan \<@ruqayya>
15+
- Abdullah Alsalemi \<@Abdol>
16+
- Dmitrii Blaginin \<@blaginin>
17+
- Srijay Deshpande \<@Srijay-lab>
18+
- Jiaqi Lv\<@Jiaqi-Lv>
1619
- George Hadjigeorgiou \<@ghadjigeorghiou>
20+
- Abishekraj Vinayagar Gnanasambandam \<@AbishekRajVG>
1721
- Wenqi Lu \<@wenqi006>
1822
- Saad Bashir \<@rajasaad>
1923

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ authors:
4444
given-names: "Shan E Ahmed"
4545
orcid: "https://orcid.org/0000-0002-1097-1738"
4646
title: "TIAToolbox as an end-to-end library for advanced tissue image analytics"
47-
version: 1.4.1 # TIAToolbox version
47+
version: 1.5.0 # TIAToolbox version
4848
doi: 10.5281/zenodo.5802442
4949
date-released: 2022-10-20
5050
url: "https://github.com/TissueImageAnalytics/tiatoolbox"

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ A reminder for the maintainers on how to deploy.
120120
Make sure all your changes are committed (including an entry in HISTORY.rst).
121121
Then run::
122122

123-
$ bump2version patch # possible: major / minor / patch
123+
$ poetry version patch # use: "poetry version --help" for other options
124124
$ git push
125125
$ git push --tags
126126

HISTORY.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,50 @@
11
# History
22

3+
## 1.5.0 (2023-12-15)
4+
5+
### Major Updates and Feature Improvements
6+
7+
- Adds the bokeh visualization tool. #684
8+
- The tool allows a user to launch a server on their machine to visualise whole slide images, overlay the results of deep learning algorithms or to select a patch from whole slide image and run TIAToolbox deep learning engines.
9+
- This tool powers the TIA demos server. For details please see https://tiademos.dcs.warwick.ac.uk/.
10+
- Extends Annotation to Support Init from WKB #639
11+
- Adds `IOConfig` for NuClick in `pretrained_model.yaml` #709
12+
- Adds functions to save the TIAToolbox Engine outputs to Zarr and AnnotationStore files. #724
13+
- Adds Support for QuPath Annotation Imports #721
14+
15+
### Changes to API
16+
17+
- Adds `model.to(device)` and `model.load_model_from_file()` functionality to make it compatible with PyTorch API. #733
18+
- Replaces `pretrained` with `weights` to make the engines compatible with the new PyTorch API. #621
19+
- Adds support for high-level imports for various utility functions and classes such as `WSIReader`, `PatchPredictor` and `imread` #606, #607,
20+
- Adds `tiatoolbox.typing` for type hints. #619
21+
- Fixes incorrect file size saved by `save_tiles`, issue with certain WSIs raised by @TomastpPereira
22+
- TissueMasker transform now returns mask instead of a list. #748
23+
- Fixes #732
24+
25+
### Bug Fixes and Other Changes
26+
27+
- Fixes `pixman` incompability error on Colab #601
28+
- Removes `shapely.speedups`. The module no longer has any affect in Shapely >=2.0. #622
29+
- Fixes errors in the slidegraph example notebook #608
30+
- Fixes bugs in WSI Registration #645, #670, #693
31+
- Fixes the situation where PatchExtractor.get_coords() can return patch coords which lie fully outside the bounds of a slide. #712
32+
- Fixes #710
33+
- Fixes #738 raised by @xiachenrui
34+
35+
### Development related changes
36+
37+
- Replaces `flake8` and `isort` with `ruff` #625, #666
38+
- Adds `mypy` checks to `root` and `utils` package. This will be rolled out in phases to other modules. #723
39+
- Adds a module to detect file types using magic number/signatures #616
40+
- Uses `poetry` for version updates instead of `bump2version`. #638
41+
- Removes `setup.cfg` and uses `pyproject.toml` for project configurations.
42+
- Reduces runtime for some unit tests e.g., #627, #630, #631, #629
43+
- Reuses models and datasets in tests on GitHub actions by utilising cache #641, #644
44+
- Set up parallel tests locally #671
45+
46+
**Full Changelog:** https://github.com/TissueImageAnalytics/tiatoolbox/compare/v1.4.0...v1.5.0
47+
348
## 1.4.1 (2023-07-25)
449

550
### Bug Fixes and Other Changes

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ include requirements/requirements.txt
77
include make.bat
88
include Makefile
99
include conf.py
10+
include tiatoolbox/visualization/bokeh_app/templates/index.html
1011

1112
recursive-include tests *
1213
recursive-include docs

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ lint: ## check style with flake8
5959
flake8 tiatoolbox tests
6060

6161
test: ## run tests quickly with the default Python
62-
pytest
62+
pytest -n auto
6363

6464
coverage: ## check code coverage quickly with the default Python
6565
pytest --cov=tiatoolbox --cov-report=term --cov-report=html --cov-report=xml

0 commit comments

Comments
 (0)