Skip to content

Hf dataset support - #47

Merged
wli51 merged 13 commits into
WayScience:mainfrom
wli51:hf-dataset-support
Dec 5, 2026
Merged

wli51 merged 13 commits into
WayScience:mainfrom
wli51:hf-dataset-support

Conversation

@wli51

@wli51 wli51 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Added support for using Hugging Face image datasets with paired image and mask data.
    • Select input and target channels, apply transforms, inspect metadata, read masks, and create subsets while retaining access to the underlying dataset.
    • Added validation for dataset columns, channel settings, and image and mask data.
  • Compatibility
    • Updated supported versions of image-processing and machine-learning packages.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f0ca64c2-9033-46e9-8bf3-7137d95438bc

No actionable comments were generated in the recent review.

Walkthrough

The pull request adds and exports HuggingFaceImageDataset for paired image data. It adds validation, metadata and image access, mask retrieval, and subset operations. It also updates dependency constraints and image-generation calls in test fixtures.

Changes: Hugging Face image dataset adapter

Layer / File(s) Summary
Add and expose the adapter contract
pyproject.toml, tests/conftest.py, tests/datasets/conftest.py, tests/datasets/ds_engine/test_crop_manifest.py, src/virtual_stain_flow/datasets/__init__.py, src/virtual_stain_flow/datasets/hf_dataset.py, tests/datasets/test_hf_dataset.py
The project adds or constrains pyarrow, pillow, mlflow, and datasets. The package exports HuggingFaceImageDataset, which validates its source dataset, columns, and channel keys. Tests add Hugging Face dataset fixtures and construction checks. Existing image fixtures no longer pass an explicit mode to Image.fromarray.
Implement dataset access and reads
src/virtual_stain_flow/datasets/hf_dataset.py, tests/datasets/test_hf_dataset.py
The adapter adds indexing, metadata access, raw image and mask reads, and subset creation. Tests cover channel ordering, raw values, index state, returned arrays, and transform behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: Minimal · previous review b89cc

This change adds a Hugging Face image dataset adapter, with tests and dependency updates. No concrete merge-blocking issue was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "Hf dataset support" names the main change: the new HuggingFaceImageDataset adapter and its tests. It is short and specific enough for a teammate scanning history. It omits the Pillow and py…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Hf dataset support" names the main change: the new HuggingFaceImageDataset adapter and its tests. It is short and specific enough for a teammate scanning history. It omits the Pillow and pyarrow dependency updates, which is acceptable because the title need not cover every detail. The title is brief and uses a common abbreviation (HF) without expansion, which is a minor clarity point.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6166fad5-7e87-4aff-b421-e3a1b7c9264c
Commits

Reviewing files that changed from the base of the PR and between 8c8eaab and b89cc91.

Files selected for processing: 7

  • pyproject.toml
  • src/virtual_stain_flow/datasets/__init__.py
  • src/virtual_stain_flow/datasets/hf_dataset.py
  • tests/conftest.py
  • tests/datasets/conftest.py
  • tests/datasets/ds_engine/test_crop_manifest.py
  • tests/datasets/test_hf_dataset.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment thread pyproject.toml Resolved
Comment thread pyproject.toml Resolved
Comment thread tests/datasets/conftest.py Resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding automated CI checks for the tests so that we can see that this passes through the PR (untainted by local dev).

Comment thread tests/datasets/test_hf_dataset.py Resolved
@review-notebook-app

Copy link
Copy Markdown

Review Notebooks

Notebooks changed:

Review visual diffs and comment on any notebook cell. All comments sync back to this PR.


Powered by ReviewNB

@wli51

wli51 commented Dec 5, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @d33bs for reviewing! Merging now!

@wli51
wli51 merged commit 81d89cb into WayScience:main Dec 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants