Repository navigation
Read stored arrays through worldarray - #48
Merged
Merged
Conversation
…, on PyPI), the tensorstore reader chunkmirage shares with cellmap-flow, cellmap-analyze and mesh-n-bone, specified with a fixture of metadata layouts as the contract: TensorStoreSource.from_array maps its ArrayMeta to an ArrayInfo, adding what only chunkmirage needs (xarray coordinate arrays where nothing placed the array, placed_by None, CF packing, the spec's overrides and kind, metadata conflicts warned rather than raised), from_path is wa.open in the array's own units on the shared context, groups wa.open_pyramid; ngff.py reads nodes through wa.detect and Node.ome_attrs and opens fields and coordinate arrays through wa.open_tensorstore; tensorstore_source.py goes from 640 lines to 200 (access, detection, the zarr compressor cleaning and every placement parser are worldarray's now), and the three access tests and the sequence half of a scene test, which worldarray's own tests cover, are removed; what changes with it: a precomputed scale opened by its key or as s<N>, a one-channel precomputed volume served as z, y, x, N5 bare-list pixelResolution, units strings and axes attributes, zarr v3 dimension_units and a scale attribute, nested dataset paths, an OME scale disagreeing with voxel_size warned, one of the wrong length refused, buckets with listing off, AWS_ENDPOINT_URL; design.md says why, formats.md and the CHANGELOG say so
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.
Stored arrays are now opened and placed by worldarray (
worldarray>=0.1,<1, on PyPI). It's the tensorstore reader chunkmirage shares with cellmap-flow, cellmap-analyze and mesh-n-bone. Its spec and its fixture of metadata layouts are the contract, and it was built from this repo'stensorstore_source.py.The adapter:
TensorStoreSource.from_arrayturns worldarray'sArrayMetainto chunkmirage'sArrayInfoand adds what only chunkmirage needs:placed_by is None);kind.Metadata conflicts are opened with
metadata_conflicts="warn", so a stale attribute doesn't make an image unservable.from_pathiswa.open(path, units=None)on the shared context; groups go throughwa.open_pyramid.ngff.pyreads nodes throughwa.detectandNode.ome_attrs, and opens fields and coordinate arrays throughwa.open_tensorstore.tensorstore_source.pygoes from 646 lines to 198. Store access, format detection, the zarr compressor cleaning and every placement parser now live in worldarray. The three access tests and the sequence half of one scene test are removed, since worldarray's own tests cover them.What changes for users:
vol/4_4_40) or asvol/s<N>.z, y, x; its channel axis is dropped.pixelResolution,unitsgiven as one string, and anaxesattribute.dimension_unitsand ascaleattribute are read as the voxel size.seg/s0) is found in an ancestor group.scalethat disagrees with the array's ownvoxel_sizenow warns, and OME wins. An OMEscaleof the wrong length is refused; main ignored it.AWS_ENDPOINT_URLis honoured.worldarray already places an array with no placement metadata the way #47 does, so placements don't move with this switch.
Before this PR, worldarray's fixture cases were run against both readers. The browser reader (
web/src/sources.ts) still differs on several N5 and OME cases. Those are its own bugs, for a separate PR that copies the fixture intoweb/test.Docs: a "Why worldarray" note in
docs/design.md, the opening of "Stored sources" indocs/concepts/formats.md, and the CHANGELOG's Sources section.uv.lockadds only worldarray; I left out the unrelated wheel-list churn from my older local uv.