Skip to content

fix(reader): fail loud on malformed metadata; read duplicate listings once - #48

Open
hongquanli wants to merge 2 commits into
mainfrom
fix/reader-review-minors
Open

hongquanli wants to merge 2 commits into
mainfrom
fix/reader-review-minors

Conversation

@hongquanli

Copy link
Copy Markdown
Collaborator

Summary

The minors deferred from the #42 review of the OME-Zarr 0.5 reader, each with a test:

  • axes that normalise to the same name (two y space axes) raise OmeZarrError instead of producing an array with duplicate dims
  • a _squid block that is not an object raises OmeZarrError, not AttributeError
  • a scale vector whose length does not match the axes: already raised, now pinned by a test
  • well field ids accept ASCII digits only (str.isdigit also accepts other scripts); 01 and 1 name the same field and the second listing is ignored with a warning, as is a well listed twice in a plate
  • a negative rowIndex / columnIndex raises instead of indexing from the end
  • a region folder holding both fov_<n>.ome.zarr stores and acquisition.zarr is refused as ambiguous
  • a root whose zarr.json exists but cannot be read is an error, not an "unknown" layout (the legacy walk would otherwise open the arrays beneath it without their metadata)
  • tests: the absent-entry warning is one record for several wells, also under an experiment folder; a file in place of a well directory is skipped

Full suite: 327 passed, 3 skipped on PyQt5 and PyQt6 (ndv 0.5.0, offscreen).

🤖 Generated with Claude Code

hongquanli and others added 2 commits November 8, 2026 10:39
… once

Deferred minors from the #42 review, each with a test:
- axes that normalise to the same name (e.g. two "y" space axes) raise
  OmeZarrError instead of producing an array with duplicate dims;
- a _squid block that is not an object raises OmeZarrError, not
  AttributeError;
- a scale vector whose length does not match the axes is pinned by a test
  (already raised);
- well field ids accept ASCII digits only (str.isdigit also accepts other
  scripts); "01" and "1" name the same field and the second listing is
  ignored with a warning, as is a well listed twice in a plate;
- a negative rowIndex/columnIndex raises instead of indexing from the end;
- a region folder holding both fov_<n>.ome.zarr stores and
  acquisition.zarr is refused as ambiguous;
- a root whose zarr.json exists but cannot be read is an error, not an
  "unknown" layout (the legacy walk would otherwise open the arrays
  beneath it without their metadata);
- tests that the absent-entry warning is one record for several wells,
  also under an experiment folder, and that a file in place of a well
  directory is skipped.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review of this PR: the dedupe keyed on the derived field number, so two
distinct paths that map to the same number lost an image ("1" and "foo" at
position 1; "1" and "01", which are distinct valid paths under the spec).
Reproduced through LightweightViewer: two fields [101, 222] displayed as
one. Dedupe now keys on the listed path; the display id is the path when it
is a plain number, else the position, and a colliding id moves to the next
free number so every image keeps a distinct id.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant