Repository navigation
0.4: read onto a grid, source_translation, adopt checks attrs, pickling, scalar writes - #8
Merged
Merged
Conversation
cellmap-analyze's three asks so its ImageDataInterface wrapper can go. read_onto(grid, begin, end) reads a Grid's voxels from an array, exactly that shape: the read of the grid's index box at its voxel size anchored at its corner, so at the array's own voxel size nothing is resampled (Behaviour 20). A handle pickles and reopens by the path resolved at open, so a worker that changes directory finds the store. write_index, write and write_chunk take a scalar, converted only when its value survives (Behaviour 13). Claude-Session: https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64
Two of cellmap-flow's asks for 0.4. source_translation is the stored level's translation in the requested units beside source_voxel_size, under resample and relabel, so its stored_placement can go. create(exists="adopt") compares every key of attrs with the existing array's attributes and names each that differs or is missing; it used to keep the old ones silently. Claude-Session: https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64
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.
cellmap-analyze's three asks, so its ImageDataInterface wrapper can be deleted and every module can call worldarray directly (its draft PR #96 works in the voxel indices of one
Gridper operation), and two of cellmap-flow's. Each one adds API, so this is 0.4.0. It has no placement change and no unit-table change.vol.read_onto(grid, begin=None, end=None, ...)(new Behaviour 20) reads voxels[begin, end)of aGrid's spatial axes from the array, exactly that shape. It is defined as thereadof the grid's index box at the grid's voxel size, anchored at the grid's corner, which is the composition cellmap-analyze writes by hand today.method="linear", so cellmap-analyze's outputs don't change.reopens, with the path resolved against the working directory at open.wa.open("b.zarr/seg/s0")unpickled after anos.chdirused to raiseFileNotFoundError; cellmap-analyze's dask workers change directory before they unpickle.vol.pathstill shows what the caller passed, and a reopened or unpickled handle shows the resolved path.write_index,writeandwrite_chunktake a scalar, which fills the box.0intouint8is written, while300,-1,0.5and NaN raise. A float array takes any value it doesn't overflow, rounded to its precision.vol.source_translation: the stored level's translation inunits, besidesource_voxel_size, under resample and relabel too. With it, cellmap-flow can drop itsstored_placementhelper.attrs(Behaviour 11).create(exists="adopt")now checks every key given inattrsagainst the existing array's attributes, and names each one that differs or is missing; keys not given are not compared. An adopt given differentattrsused to keep the old ones without saying so, the same way funlib'sprepare_dsonce kept an old offset. This is a behaviour change for callers that adopt with differentattrs.Spec section 2 has a new 0.4 block. Behaviours 11 and 13 are amended, Behaviour 20 is new, and the Tests section is updated. The README API brief and the changelog are updated, and the version is bumped in pyproject,
__init__and uv.lock. The suite has 179 tests.https://claude.ai/code/session_0141wgF8mkGbjGfBFKfKhp64