Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 29 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ repos:
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-json
- id: check-merge-conflict
- id: detect-private-key
- id: forbid-new-submodules
- id: forbid-submodules
Expand All @@ -43,15 +45,28 @@ repos:
exclude: \.json$
- id: requirements-txt-fixer

- repo: https://github.com/ternaus/ruff-policy-hooks
rev: v0.4.0
hooks:
- id: check-ruff-suppressions
name: Protect mandatory Ruff complexity diagnostics
args: [--protect=C901,PLR0911,PLR0912,PLR0913,PLR0915,PLR0917]
Comment thread
ternaus marked this conversation as resolved.

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.12
rev: v0.16.8
hooks:
- id: ruff
- id: ruff-check
args: [--fix]
- id: ruff-format

- repo: https://github.com/asottile/pyupgrade
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py311-plus]

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.11.8
rev: 0.12.16
hooks:
- id: uv-lock

Expand All @@ -64,27 +79,33 @@ repos:
- id: text-unicode-replacement-char

- repo: https://github.com/codespell-project/codespell
rev: v2.4.2
rev: v2.4.3
hooks:
- id: codespell
additional_dependencies: ["tomli"]
additional_dependencies: ["tomli>=2.4.1"]
exclude: \.json$

- repo: https://github.com/ternaus/opencv-rgb-precommit
rev: v0.1.1
hooks:
- id: check-opencv-rgb

- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.21.1"
rev: "v2.29.4"
hooks:
- id: pyproject-fmt
args: [--max-supported-python=3.14]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.20.2
rev: v2.3.1
hooks:
- id: mypy
files: ^imread_benchmark/
additional_dependencies: [types-PyYAML]
args: [--config-file=pyproject.toml]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
rev: v0.11.0.1-1
hooks:
- id: shellcheck
args: [--severity=warning]
14 changes: 9 additions & 5 deletions imread_benchmark/analysis/fodb_paper.py
Original file line number Diff line number Diff line change
Expand Up @@ -960,9 +960,11 @@ def _summary_markdown(evidence: dict[str, Any]) -> str:
"",
"## Compatibility audit",
"",
"The empty-DHT test measures recovery from one malformed bitstream pattern. "
"The four-component test measures conversion to the normalized three-channel RGB contract; "
"the sentinel is not classified as corrupt.",
(
"The empty-DHT test measures recovery from one malformed bitstream pattern. "
"The four-component test measures conversion to the normalized three-channel RGB contract; "
"the sentinel is not classified as corrupt."
),
"",
"| Decoder | Empty-DHT bitstreams | Four-component RGB | Combined |",
"| --- | ---: | ---: | ---: |",
Expand All @@ -981,8 +983,10 @@ def _summary_markdown(evidence: dict[str, Any]) -> str:
"",
"## Protocol decision",
"",
"| Workload | Platform | Decode leader | Loader leader | Workers | Regret | "
"Spearman rho | Top 10% throughput group |",
(
"| Workload | Platform | Decode leader | Loader leader | Workers | Regret | "
"Spearman rho | Top 10% throughput group |"
),
"| --- | --- | --- | --- | ---: | ---: | ---: | --- |",
],
)
Expand Down
16 changes: 10 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ optional-dependencies.plot = [ "matplotlib>=3.8", "seaborn>=0.13" ]
optional-dependencies.tensorflow = [ "tensorflow" ]
scripts.imread-benchmark = "imread_benchmark.cli:app"
entry-points."imread_benchmark.decoders".ajpegli = "imread_benchmark.decoders.ajpegli_decoder:AJpegliDecoder"
entry-points."imread_benchmark.decoders".imagecodecs = "imread_benchmark.decoders.imagecodecs_decoder:ImageCodecsDecoder"
entry-points."imread_benchmark.decoders".imagecodecs = """\
imread_benchmark.decoders.imagecodecs_decoder:ImageCodecsDecoder\
"""
entry-points."imread_benchmark.decoders".imageio = "imread_benchmark.decoders.imageio_decoder:ImageIODecoder"
entry-points."imread_benchmark.decoders".jpeg4py = "imread_benchmark.decoders.jpeg4py_decoder:Jpeg4pyDecoder"
entry-points."imread_benchmark.decoders".kornia = "imread_benchmark.decoders.kornia_decoder:KorniaDecoder"
Expand All @@ -64,7 +66,9 @@ entry-points."imread_benchmark.decoders".pyvips = "imread_benchmark.decoders.pyv
entry-points."imread_benchmark.decoders".simplejpeg = "imread_benchmark.decoders.simplejpeg_decoder:SimpleJpegDecoder"
entry-points."imread_benchmark.decoders".skimage = "imread_benchmark.decoders.skimage_decoder:SkimageDecoder"
entry-points."imread_benchmark.decoders".tensorflow = "imread_benchmark.decoders.tensorflow_decoder:TensorFlowDecoder"
entry-points."imread_benchmark.decoders".torchvision = "imread_benchmark.decoders.torchvision_decoder:TorchvisionDecoder"
entry-points."imread_benchmark.decoders".torchvision = """\
imread_benchmark.decoders.torchvision_decoder:TorchvisionDecoder\
"""
entry-points."imread_benchmark.decoders".turbojpeg = "imread_benchmark.decoders.turbojpeg_decoder:TurboJPEGDecoder"

[dependency-groups]
Expand Down Expand Up @@ -178,13 +182,13 @@ lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.mypy]
ignore_missing_imports = true
follow_imports = "silent"
warn_redundant_casts = true
warn_unused_ignores = true
disallow_any_generics = true
check_untyped_defs = true
no_implicit_reexport = true
disallow_untyped_defs = true
check_untyped_defs = true
warn_redundant_casts = true
warn_unused_ignores = true
overrides = [ { module = [ "skimage.*", "tifffile.*" ], follow_imports = "skip" } ]
no_implicit_reexport = true

[tool.pytest]
ini_options.testpaths = [ "tests" ]
Loading