diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml
index a6bf3b6c1..5fcbe3905 100644
--- a/.github/workflows/python-package.yml
+++ b/.github/workflows/python-package.yml
@@ -30,7 +30,7 @@ jobs:
sudo apt update
sudo apt-get install -y libopenslide-dev openslide-tools libopenjp2-7 libopenjp2-tools
python -m pip install --upgrade pip
- python -m pip install ruff==0.9.9 pytest pytest-cov pytest-runner
+ python -m pip install ruff==0.11.4 pytest pytest-cov pytest-runner
pip install -r requirements/requirements.txt
- name: Cache tiatoolbox static assets
uses: actions/cache@v3
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 7691af305..a71419e89 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -60,7 +60,7 @@ repos:
- id: rst-inline-touching-normal # Detect mistake of inline code touching normal text in rst.
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
- rev: v0.9.9
+ rev: v0.11.4
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
diff --git a/benchmarks/annotation_store.ipynb b/benchmarks/annotation_store.ipynb
index b3ba543f8..6cf6cf8e6 100644
--- a/benchmarks/annotation_store.ipynb
+++ b/benchmarks/annotation_store.ipynb
@@ -2417,7 +2417,7 @@
" return_counts=True,\n",
" )\n",
" total = np.sum(counts)\n",
- " frequencies = {v: 0 for v in range(256)}\n",
+ " frequencies = dict.fromkeys(range(256), 0)\n",
" for v, x in zip(values, counts):\n",
" frequencies[v] = x / total\n",
" frequency_array = np.array(list(frequencies.values()))\n",
diff --git a/docs/conf.py b/docs/conf.py
index a16b690a8..143a9fe94 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,5 +1,10 @@
#!/usr/bin/env python
-# flake8: noqa
+"""Defines configuration for sphinx and readthedocs."""
+
+from __future__ import annotations
+
+import logging
+
#
# tiatoolbox documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
@@ -12,18 +17,17 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.
-
# If extensions (or modules to document with autodoc) are in another
# directory, add these directories to sys.path here. If the directory is
# relative to the documentation root, use os.path.abspath to make it
# absolute, like shown here.
#
import os
-from pathlib import Path
import shutil
import sys
+from pathlib import Path
-sys.path.insert(0, os.path.abspath(".."))
+sys.path.insert(0, str(Path("..").resolve()))
import tiatoolbox
@@ -84,7 +88,7 @@
# General information about the project.
project = "TIA Toolbox"
-copyright = "2025, TIA Lab"
+copyright = "2025, TIA Lab" # noqa: A001
author = "TIA Lab"
# The version info for the project you're documenting, acts as replacement
@@ -134,15 +138,18 @@
#
html_theme_options = {
"navigation_with_keys": True,
- "top_of_page_button": None,
+ "top_of_page_buttons": ["view", "edit"],
"footer_icons": [
{
"name": "TIA",
"url": "https://warwick.ac.uk/fac/cross_fac/tia/",
"html": """
-
""",
@@ -1873,8 +1887,19 @@
"name": "GitHub",
"url": "https://github.com/TissueImageAnalytics/tiatoolbox",
"html": """
-