Skip to content

Use DirectoryStore to save/edit/load zarr files as it allows updating/replacing existing keys, (ZipStore) does not #16

@cudmore

Description

@cudmore

ZipStore does not allow mutations on the zip file. Because of this, we can't save run-time edits back to the ZipStore.

Instead we need to save zarr using DirectoryStore which does allow mutations on the store, and in particular mutations on individual pieces such as (points, lines, images, etc).

For example, when the user edits points we want to save the new points but not touch other parts of the zarr such as (lines, images, etc).

See zarrLoadSave.py for my example code to achieve this.

This needs to be refactored into the main class library.

The main ideas are:

  1. Use something like createZarr() when we create a zarr from scratch. This will wholesale save everything and assumes a zarr file/folder does not exist.
  2. Use something like updateZarr() to save modified items (e.g. dirty items) during runtime. Idea here is that during normal editing runtime, we have some granuality on which part of zarr to save. If points have been edited then save them. Only save parts that are dirty.
  3. Finally our loading is slightly different, by default it uses a DirectoryStore, see loadZarr()

Finally, we can reserve using the ZipStore for pure export to some other system.

In an informal test, it seems the DirectoryStore and ZipStore have about the same file-size on the hard-drive.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions