Skip to content

worldarray 0.3: served metadata, chunk keys and the browser reader - #51

Merged
davidackerman merged 1 commit into
mainfrom
feature/worldarray-0.3
Oct 22, 2026
Merged

davidackerman merged 1 commit into
mainfrom
feature/worldarray-0.3

Conversation

@davidackerman

Copy link
Copy Markdown
Member

Moves chunkmirage to worldarray 0.3 and removes code worldarray now covers, on the server and in the browser engine.

Server

  • Pin. worldarray>=0.3,<1. uv.lock changes only worldarray, from 0.1.0 to 0.3.0, with no new dependencies.
  • Precomputed bug fixed. A precomputed scale with a non-zero voxel_offset returned 404 for every chunk. The server parsed chunk keys from 0, while Neuroglancer and tensorstore count them from the offset (3-19_2-18_1-9 for offset [3, 2, 1]). test_precomputed_voxel_offset_becomes_translation now checks both keys, and fails on main.
  • Chunk keys come from worldarray. Every format's keys go through wa.chunk_key and wa.parse_chunk_key, called from one Frontend.chunk_request. It replaces four regex parsers. zarr v2 still accepts either separator.
  • OME multiscales come from worldarray. frontends/_ome.py now calls wa.ome_multiscales and drops its own unit and axis-type tables. What changes in the served metadata:
    • a translation is written even when it is 0;
    • OME 0.5 has version only beside multiscales, no longer inside each multiscale too;
    • an axis whose name is neither spatial, nor c, nor time is left untyped;
    • the multiscale no longer carries "type": "chunkmirage" or a description.
  • N5 levels with no offset now have their corner at the origin at every level, worldarray's rule since 0.1.1. The one test that pinned the BigDataViewer placement follows.
  • Unchanged. N5 attributes and precomputed info stay chunkmirage's own, since worldarray writes neither.

Browser engine

  • web/src/placement.ts ports worldarray's placement rules to TypeScript. It replaces the separate placement code in openImage, the N5 reader, the xarray reader and the precomputed reader. Fixes that come with it:

    • an OME multiscale's own coordinateTransformations are applied;
    • OME 0.6's intrinsic coordinate system is read, where it threw before;
    • N5's offset is applied, and an N5 level with no offset has its corner at the origin;
    • funlib's voxel_size and a COSEM transform on an array are read;
    • pixelResolution or resolution on an N5 group is read;
    • a zarr array outside an OME group opens (funlib, COSEM, or xarray, now of three axes or more), and a single N5 array opens.
  • web/src/layout.ts types axes as worldarray does. A channel axis was typed space, and so was a t axis without a time unit.

  • web/test/metadata.test.ts runs worldarray 0.3.0's two fixtures, copied unchanged (I checked them against the PyPI sdist):

    • 23 metadata layouts, each placed where worldarray places it;
    • 14 OME documents, each written as worldarray writes it. The 15th case is left out because the browser writes neither a multiscale type nor its metadata.

    Breaking either placement or typing on purpose makes the test fail.

Docs

  • formats.md: the placement table, the N5 rule, precomputed keys and the browser reader.
  • design.md: the worldarray note.
  • The CHANGELOG.

Not done

  • neuroglancer.py's unit tables stay, because worldarray's unit table has no kilometre, and a test covers km.
  • The parts of ngff.py that read scene:// stay. They handle OME 0.6 drafts that worldarray doesn't.

…are wa.ome_multiscales (a translation written even when 0, 0.5's version only beside multiscales, an axis neither spatial, channel nor time untyped, no type or description of chunkmirage's) and every format's chunk keys wa.chunk_key and wa.parse_chunk_key through one Frontend.chunk_request, which fixes a precomputed scale with a voxel_offset 404ing on every chunk (its keys are counted from the offset, as Neuroglancer and tensorstore ask for them); an N5 level with no offset has its corner at the origin at every level, worldarray's rule since 0.1.1, and its test follows; the browser engine places stored arrays by worldarray's rules in web/src/placement.ts (OME 0.4/0.5 with a multiscale's own transforms and 0.6's intrinsic system, funlib and COSEM attributes on an array or funlib's on its group, N5 by transform, multiscales, voxel_size, pixelResolution or resolution with downsamplingFactors and offset, precomputed), used by openImage, a zarr array outside an OME group (xarray's folded in) and N5 groups and single arrays, and its OME builder types axes as worldarray does (channel, time by name or unit, space when spatial); web/test/metadata.test.ts runs worldarray 0.3.0's two fixtures, 23 layouts read and 14 multiscales written; formats.md, design.md and the CHANGELOG say so
@davidackerman
davidackerman marked this pull request as ready for review October 22, 2026 22:18
@davidackerman
davidackerman merged commit b834c67 into main Oct 22, 2026
2 checks passed
@davidackerman
davidackerman deleted the feature/worldarray-0.3 branch October 22, 2026 22:18
davidackerman added a commit that referenced this pull request Oct 22, 2026
Fix the registration demos after #51: axis types and arrays without attributes
@davidackerman davidackerman mentioned this pull request Oct 23, 2026
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