Skip to content

Conversation

@d33bs
Copy link
Member

@d33bs d33bs commented Jan 10, 2026

Description

This PR adds an image_type key to the spec, enabling one to indicate what type of image will be included. This is intended to help with downstream applications where one might want to differentiate from a label (masks, outlines, etc), raw image, or others.

Closes #16

What kind of change(s) are included?

  • Documentation (changes docs or other related content)
  • Bug fix (fixes an issue).
  • Enhancement (adds functionality).
  • Breaking change (these changes would cause existing functionality to not work as expected).

Checklist

Please ensure that all boxes are checked before indicating that this pull request is ready for review.

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have searched for existing content to ensure this is not a duplicate.
  • I have performed a self-review of these additions (including spelling, grammar, and related).
  • These changes pass all pre-commit checks.
  • I have added comments to my code to help provide understanding
  • I have added a test which covers the code changes found within this PR
  • I have deleted all non-relevant text in this pull request template.

Summary by CodeRabbit

  • New Features

    • Added optional image_type metadata so imports/exports can include and preserve image kind (e.g., "image", "label").
  • Backward Compatibility

    • Older records without image_type remain readable; missing values default to None.
  • Tests

    • Added test verifying round-trip preservation of image_type.
  • Chores

    • Bumped pre-commit hooks: ruff to v0.14.13 and yamllint to v1.38.0

✏️ Tip: You can customize this high-level summary in your review settings.

@d33bs d33bs marked this pull request as ready for review January 13, 2026 18:06
@d33bs d33bs requested a review from MikeLippincott January 13, 2026 18:06
@d33bs
Copy link
Member Author

d33bs commented Jan 15, 2026

@coderabbitai full review

@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds an optional image_type field to the OME-Arrow schema and threads it through ingestion, construction, and IO paths so records can carry image/label/mask semantics when created from numpy, TIFF, OME-Zarr, OME-Parquet, stack patterns, or Vortex inputs; older records without the field remain readable.

Changes

Cohort / File(s) Summary
Specification & Data Structure
src/ome_arrow/meta.py
Added image_type (string) field to OME_ARROW_STRUCT (positioned after name).
Core API
src/ome_arrow/core.py
OMEArrow.__init__ gains `image_type: str
Ingestion Functions
src/ome_arrow/ingest.py
`to_ome_arrow(..., image_type: str
Tests
tests/conftest.py, tests/test_core.py
example_correct_data now includes image_type: "image"; added test_parquet_roundtrip_preserves_image_type to verify round-trip preservation.
Developer tooling
.pre-commit-config.yaml
Bumped hook versions: yamllint v1.37.1 → v1.38.0, ruff-pre-commit v0.14.10 → v0.14.13.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant Core as OMEArrow Core
  participant Ingest as Ingest Layer
  participant Storage as Storage (Parquet/Zarr/TIFF)

  User->>Core: instantiate OMEArrow(data, image_type="label")
  Core->>Ingest: dispatch to loader (from_numpy/from_tiff/from_ome_zarr/...)
  Ingest->>Ingest: to_ome_arrow(..., image_type="label") -> build record with image_type
  Ingest->>Storage: write/read record (may include image_type or None)
  Storage->>Core: return loaded record
  Core->>User: return OMEArrow instance with image_type preserved
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 I hopped a patch to add a name,
A tiny tag to mark the frame,
"image" or "label," soft and light,
It travels with each byte at night,
Hooray — the data knows its game.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change—adding an image_type key to the specification.
Linked Issues check ✅ Passed The PR implements the core requirement from issue #16 to add a differentiator field (image_type) to the spec for distinguishing image types/roles.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the image_type feature; no unrelated modifications were introduced.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.



📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ae7bc25 and 6c8b9e7.

📒 Files selected for processing (1)
  • .pre-commit-config.yaml

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@MikeLippincott MikeLippincott left a comment

Choose a reason for hiding this comment

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

LGTM! Exciting to see this work!

@d33bs
Copy link
Member Author

d33bs commented Jan 16, 2026

Thanks @MikeLippincott !

@d33bs d33bs merged commit e925345 into WayScience:main Jan 16, 2026
0 of 10 checks passed
@d33bs d33bs deleted the spec-key-for-type branch January 16, 2026 00:24
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.

Create a label flag inside the spec

2 participants