Module MemoryStore.Array

val create : ?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.Array.t -> t -> unit Deferred.t

create ~sep ~dimension_names ~attributes ~codecs ~shape ~chunks kind fill node t creates an array node in store t where:

  • Separator sep is used in the array's chunk key encoding.
  • Dimension names dimension_names and user attributes attributes are included in it's metadata document.
  • A codec chain defined by codecs.
  • The array has shape shape and chunk shape chunks.
  • The array has data kind kind and fill value fv.
  • raises Codecs.Bytes_to_bytes_invariant

    if codecs contains more than one bytes->bytes codec.

  • raises Codecs.Invalid_transpose_order

    if codecs contains a transpose codec with invalid order array.

  • raises Codecs.Invalid_sharding_chunk_shape

    if codecs contains a shardingindexed codec with an incorrect inner chunk shape.

metadata node t returns the metadata of array node node.

  • raises Key_not_found

    if node is not a member of store t.

val delete : t -> Zarr.Node.Array.t -> unit Deferred.t

delete t n erases array node n from store t. If node n is not a member of store t then this is a no-op.

val exists : t -> Zarr.Node.Array.t -> bool Deferred.t

exists t n returns true if array node n is a member of store t and false otherwise.

write t n s x writes n-dimensional array x to the slice s of array node n in store t.

  • raises Invalid_array_slice

    if the ndarray x size does not equal slice s.

  • raises Invalid_data_type

    if the kind of x is not compatible with node n's data type as described in its metadata document.

read t n s k reads an n-dimensional array of size determined by slice s from array node n.

  • raises Invalid_data_type

    if kind k is not compatible with node n's data type as described in its metadata document.

  • raises Invalid_array_slice

    if the slice s is not a valid slice of array node n.

val reshape : t -> Zarr.Node.Array.t -> int array -> unit Deferred.t

reshape t n shape resizes array node n of store t into new size shape. Note that when the resizing involves shrinking an array along any dimensions, any old unreachable chunks that fall outside of the array's new shape are deleted from the store.

  • raises Invalid_resize_shape

    if shape does not have the same dimensions as n's shape.

  • raises Key_not_found

    if node n is not a member of store t.

val rename : t -> Zarr.Node.Array.t -> string -> unit Deferred.t

rename t n name changes the name of array node n in store t to name.

  • raises Key_not_found

    if g is not a member of store t.

  • raises Renaming_root

    if g is the store's root node.

  • raises Node_invariant

    if name is an invalid node name.