Skip to content

0.3: grids and blocks - #4

Merged
davidackerman merged 7 commits into
mainfrom
grid-0.3
Oct 22, 2026
Merged

davidackerman merged 7 commits into
mainfrom
grid-0.3

Conversation

@davidackerman

Copy link
Copy Markdown
Member

worldarray 0.3: grids and blocks, built to spec draft 3 (Behaviours 17 to 19). Stacked on PR #3 (0.2); its base is the write-0.2 branch and it retargets to main once #3 merges. 157 tests pass (136 after 0.2, 21 new).

  • wa.blocks(shape, block_shape, context=0, box=None, clip=True): the array, or a voxel box that may reach past it, cut into write boxes that tile with no overlap and no gap; each block carries its read box grown by context (int, per axis, or (before, after) pairs) and clipped to the array when clip, plus at_start/at_end per axis and inner, the write box's slices inside the read box. C order, len, blocks[id] in O(1), index_of. Plain picklable records; the iterable pickles without its blocks. Nothing is scheduled. vol.blocks() defaults to write_shape; vol.write_chunk(index, data) writes one whole unit.
  • wa.Grid: a WorldArray without a store (box, corner, index_box, chunks_covering, write_shape, blocks, meta); Grid.from_meta(meta, voxel_size=) is an array's grid or the resample target grid over it; wa.create(path, grid=g, dtype=) creates from it and reports the same shape, chunks, shards, axes, units and placement.
  • wa.level_factors: the anisotropy-aware pyramid schedule mesh-n-bone and cellmap-analyze share, per level, with a stop rule.
  • wa.units.abbreviation; wa.store.join / parent / basename public.

The grid module was built by an Opus subagent from the spec in an isolated worktree and reviewed here; the two block-iterator consumers (mesh-n-bone, cellmap-analyze) confirmed the shape before it was built, and their additions are in Behaviour 17. Open question 6 is resolved.

https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64

worldarray.grid, re-exported at the top level: Block, blocks (a picklable
Blocks record computing each block from its id), Grid (a store-less grid
with box, corner, index_box, chunks_covering, write_shape, blocks, meta
and from_meta) and level_factors. units.abbreviation gives the OME short
form for every spelling the unit table knows; store.join, parent and
basename are public and wa.store is exported. Behaviours 17 to 19; the
WorldArray side (vol.blocks, write_chunk, create(grid=)) is left to the
write module.

Claude-Session: https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64
# Conflicts:
#	src/worldarray/__init__.py
vol.blocks() (block_shape defaults to write_shape), vol.write_chunk(index,
data) for one whole write unit, wa.create(path, grid=g, dtype=) taking shape,
placement, axes, units, chunks and shards from a Grid, Grid.meta carrying the
shard shape. Spec Behaviour 17 gains what the two block-iterator consumers
asked for and the subagent built: a box that may reach past the array with
only read boxes clipped, at_start/at_end per axis, inner slices, a picklable
iterable with O(1) blocks[id]; Behaviour 18 names the fields a grid's meta
shares with the created array's; Open question 6 is resolved. README and
CHANGELOG for 0.3.0.

Claude-Session: https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64
Base automatically changed from write-0.2 to main October 22, 2026 21:46
Open question 13 (world boxes on blocks) closed as not planned: daisy stays
in cellmap-flow.

Claude-Session: https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64
The previous commit kept the conflict markers around the 0.2.0 heading.

Claude-Session: https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64
The merge resolution kept main's side only and lost the 0.3.0 entry.

Claude-Session: https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64
@davidackerman
davidackerman merged commit 75cd4b8 into main Oct 22, 2026
4 checks passed
@davidackerman
davidackerman deleted the grid-0.3 branch October 22, 2026 21:51
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