package zarr-lwt
Module Storage.MemoryStoreSource
An in-memory storage backend for Zarr V3 hierarchy.
include Zarr.Storage.STORE with type 'a Deferred.t = 'a Lwt.t
module Deferred : Zarr.Types.Deferred with type 'a t = 'a Lwt.tval create_group :
?attrs:Yojson.Safe.t ->
t ->
Zarr.Node.GroupNode.t ->
unit Deferred.tcreate_group ?attrs t node creates a group node in store t containing attributes attrs. This is a no-op if node is already a member of this store.
val create_array :
?sep:[< `Dot | `Slash Slash ] ->
?dimension_names:string option list ->
?attributes:Yojson.Safe.t ->
codecs:Zarr.Codecs.codec_chain ->
shape:int array ->
chunks:int array ->
'a Zarr.Ndarray.dtype ->
'a ->
Zarr.Node.ArrayNode.t ->
t ->
unit Deferred.tcreate_array ~sep ~dimension_names ~attributes ~codecs ~shape ~chunks kind fill node t creates an array node in store t where:
- Separator
sepis used in the array's chunk key encoding. - Dimension names
dimension_namesand user attributesattributesare included in it's metadata document. - A codec chain defined by
codecs. - The array has shape
shapeand chunk shapechunks. - The array has data kind
kindand fill valuefv.
val array_metadata :
t ->
Zarr.Node.ArrayNode.t ->
Zarr.Metadata.ArrayMetadata.t Deferred.tarray_metadata node t returns the metadata of array node node.
val group_metadata :
t ->
Zarr.Node.GroupNode.t ->
Zarr.Metadata.GroupMetadata.t Deferred.tgroup_metadata node t returns the metadata of group node node.
val find_child_nodes :
t ->
Zarr.Node.GroupNode.t ->
(Zarr.Node.ArrayNode.t list * Zarr.Node.GroupNode.t list) Deferred.tfind_child_nodes t n returns a tuple of child nodes of group node n. This operation returns a pair of empty lists if node n has no children or is not a member of store t.
val find_all_nodes :
t ->
(Zarr.Node.ArrayNode.t list * Zarr.Node.GroupNode.t list) Deferred.tfind_all_nodes t returns Some p where p is a pair of lists representing all nodes in store t. The first element of the pair is a list of all array nodes, and the second element is a list of all group nodes. This operation returns a pair of empty lists if store t is empty.
val erase_group_node : t -> Zarr.Node.GroupNode.t -> unit Deferred.terase_group_node t n erases group node n from store t. This also erases all child nodes of n. If node n is not a member of store t then this is a no-op.
val erase_array_node : t -> Zarr.Node.ArrayNode.t -> unit Deferred.terase_array_node t n erases group node n from store t. This also erases all child nodes of n. If node n is not a member of store t then this is a no-op.
val erase_all_nodes : t -> unit Deferred.terase_all_nodes t clears the store t by deleting all nodes. If the store is already empty, this is a no-op.
val group_exists : t -> Zarr.Node.GroupNode.t -> bool Deferred.tgroup_exists t n returns true if group node n is a member of store t and false otherwise.
val array_exists : t -> Zarr.Node.ArrayNode.t -> bool Deferred.tarray_exists t n returns true if array node n is a member of store t and false otherwise.
val write_array :
t ->
Zarr.Node.ArrayNode.t ->
Zarr.Ndarray.Indexing.index array ->
'a Zarr.Ndarray.t ->
unit Deferred.twrite_array t n s x writes n-dimensional array x to the slice s of array node n in store t.
val read_array :
t ->
Zarr.Node.ArrayNode.t ->
Zarr.Ndarray.Indexing.index array ->
'a Zarr.Ndarray.dtype ->
'a Zarr.Ndarray.t Deferred.tread_array t n s k reads an n-dimensional array of size determined by slice s from array node n.
val reshape : t -> Zarr.Node.ArrayNode.t -> int array -> unit Deferred.treshape t n shape resizes array node n of store t into new size shape.