Skip to content

🆕 Convert contrast_enhancer to rust (cont.) - #1174

Draft
abdol wants to merge 25 commits into
developfrom
rust-contrast-enhancer
Draft

abdol wants to merge 25 commits into
developfrom
rust-contrast-enhancer

Conversation

@abdol

@abdol abdol commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

This PR continues #1141 carried out by @hannah275. I created a separate branch out of the one in the other PR as it was pointing to a fork of the repo.

Adds the following functionality:

  • A Rust-based contrast enhancer in addition to a number of utility functions.
  • A Jupyter notebook to demonstrate performance improvements.

@abdol abdol added the enhancement New feature or request label Oct 23, 2026
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Comment on lines +9 to +52
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.12"
- name: Install dependencies
run: |
sudo apt update
sudo apt-get install -y libopenjp2-7 libopenjp2-tools
python -m pip install --upgrade pip
python -m pip install ruff==0.16.1 pytest pytest-cov pytest-runner
pip install uv
uv pip install --system torch torchvision --index-url https://download.pytorch.org/whl/cpu
uv pip install --system -e .
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::too_many_arguments
- name: Run Rust coverage
shell: bash
run: |
source <(cargo llvm-cov show-env --sh)
cargo llvm-cov clean --workspace
python -m pip install --force-reinstall --no-deps -e .
python -m pytest tests/rust -v
cargo test --all-features
cargo llvm-cov report --lcov --output-path lcov.info
- name: Upload Rust coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: lcov.info
flags: rust
fail_ci_if_error: false
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.07692% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 99.91%. Comparing base (c4a5afa) to head (e6a79f6).

Files with missing lines Patch % Lines
tiatoolbox/rust/utils/misc/src/lib.rs 97.91% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1174      +/-   ##
===========================================
- Coverage    99.91%   99.91%   -0.01%     
===========================================
  Files          117      118       +1     
  Lines        13587    13639      +52     
  Branches      1624     1625       +1     
===========================================
+ Hits         13576    13627      +51     
- Misses           5        6       +1     
  Partials         6        6              
Flag Coverage Δ
rust 97.91% <97.91%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants