Repository navigation
Add streaming iter_image_summaries (contiguity required) - #81
Merged
Merged
Conversation
…ries (#58) New generator API that holds one image's planes at a time and requires the Z/T rows of an image to be contiguous; non-contiguous input is refused, not staged or sorted. image_summaries is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scma6W3LC11s3qjXHZuGDm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Implements the owner's decision on issue #58: a new streaming API, contiguity required (refused otherwise), eager API unchanged.
iter_image_summaries(records, percentile)is a generator. It holds one image's planes at a time, yields that image'sImageSummarywhen the next image starts, and drops the histograms. Each summary equals the eager one (same_summary).ValueError: an image whose rows are not together, a source file under two label sets, repeatedplane_id, and different channel counts.image_summariesbehaviour is unchanged. Only the percentile check moved into a shared helper.Regression tests (tests/test_summaries.py)
test_streaming_summaries_equal_the_eager_ones,test_streaming_emits_one_image_at_a_time_and_drops_its_histograms,test_streaming_refuses_rows_that_are_not_together, and the othertest_streaming_*tests.mainsource the test module fails at collection:ImportError, becauseiter_image_summariesdoes not exist. All pass on the new code.Checks
python tools/check.py: 720 passed, 2 skipped (tests/test_rgb.py:80, optionalcsbdeepnot installed; not claimed as passed), 4 warnings (pre-existing, intest_pooling.py). The code-rules and ruff step is clean.Part of #58? Fully implements the decided scope (streaming API plus refusal), so: Fixes #58 for the decided scope. The issue's benchmarks and external-sort mode were not part of the decision.
Generated by Claude Code