Repository navigation
feat: TIFF series the reader cannot place are refused by name (TIFFError.unsupportedSeries) - #62
Merged
Merged
Conversation
…ror.unsupportedSeries) A multi-page TIFF whose pages do not make one series the reader takes now throws TIFFError.unsupportedSeries(file:series:) with the file name and the kind of series: an OME-TIFF series, a pyramid of reduced-resolution pages (the reduced bit, or a page one sampling step below the first, as tifffile pyramidize_series does), N series of pages that differ in shape, type or layout, and the ImageJ and shaped stacks it cannot place. Before, these threw FormatoReadError.unsupported without the file name. Tests: TIFFSeriesRefusalTests builds multi-page TIFFs byte by byte (two shapes, a reduced pyramid, a half-size page without the bit, an OME description) and checks the typed case and its text; a uniform stack still reads. Migration: code that caught FormatoReadError.unsupported for these files catches TIFFError.unsupportedSeries instead; an exhaustive switch on TIFFError adds the case. Done: series refusals are typed and named (part of #6). Next: vendor pixel-size calibrations (TVIPS, Zeiss SEM, JEOL SightX) in their own PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Requested by Paul · project thread
Part of #6
Summary
A multi-page TIFF whose pages do not make one series the reader takes is now refused with a typed, named error,
TIFFError.unsupportedSeries(file:series:), instead of a genericFormatoReadError.unsupportedwithout the file name.The kinds: an OME-TIFF series; a pyramid of reduced-resolution pages (a page with the reduced bit, or a page one
sampling step below the first, as tifffile
pyramidize_seriesdoes in its generic rule); N series of pages that differin shape, type or layout; and the ImageJ and tifffile-shaped stacks the reader cannot place. No file that reads today
is refused; only the error on paths that already refused changes. The DocC article names the new case.
Migration
Code that caught
FormatoReadError.unsupportedfor these files catchesTIFFError.unsupportedSeriesinstead. Anexhaustive
switchonTIFFErroradds the new case (the apps only useif case, so they need no change).Tests
TIFFSeriesRefusalTests(new) does not compile on main, as the case does not exist; green on this branch.bit, an OME description; each checks the typed case, the file name and the text. A uniform stack still reads.
tools/test.sh --skip FormatoKitParityTests -j 1: green, no warnings.aligned with tifffile after the review.
Remaining in #6
🤖 Generated with Claude Code