Skip to content

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

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

abdol wants to merge 18 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

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c0bbb14) to head (dc34d1f).

Additional details and impacted files
@@             Coverage Diff              @@
##           develop     #1174      +/-   ##
============================================
+ Coverage    99.91%   100.00%   +0.08%     
============================================
  Files          112        16      -96     
  Lines        13454      1291   -12163     
  Branches      1610         0    -1610     
============================================
- Hits         13443      1291   -12152     
+ Misses           5         0       -5     
+ Partials         6         0       -6     
Flag Coverage Δ
rust 100.00% <100.00%> (?)

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