Metadata.ArrayA module which contains functionality to work with a parsed JSON Zarr array metadata document.
val create :
?sep:[< `Dot | `Slash Slash ] ->
?dimension_names:string option list ->
?attributes:Yojson.Safe.t ->
codecs:Codecs.Chain.t ->
shape:int list ->
'a Ndarray.dtype ->
'a ->
int list ->
tcreate ~codecs ~shape kind fv cshp Creates a new array metadata document with codec chain codecs, shape shape, fill value fv, data type kind and chunk shape cshp.
val encode : t -> stringencode t returns a byte string representing a JSON Zarr array metadata.
val decode : string -> tdecode s decodes a bytes string s into a ArrayMetadata.t type.
val shape : t -> int listshape t returns the shape of the zarr array represented by metadata type t.
val chunk_shape : t -> int listchunk_shape t returns the shape a chunk in this zarr array.
val is_valid_kind : t -> 'a Ndarray.dtype -> boolis_valid_kind t kind checks if kind is a valid Bigarray kind that matches the data type of the zarr array represented by this metadata type.
val fillvalue_of_kind : t -> 'a Ndarray.dtype -> 'afillvalue_of_kind t kind returns the fill value of uninitialized chunks in this zarr array given kind. Raises Failure if the kind is not compatible with this array's fill value.
val attributes : t -> Yojson.Safe.tattributes t Returns a Yojson type containing user attributes assigned to the zarr array represented by t.
val dimension_names : t -> string option listdimension_name t returns a list of dimension names. If none are defined then an empty list is returned.
val codecs : t -> Codecs.Chain.tcodecs t Returns a type representing the chain of codecs applied when decoding/encoding a Zarr array chunk.
val index_coord_pair : t -> int list -> int list * int listindex_coord_pair t coord maps a coordinate of this Zarr array to a pair of chunk index and coordinate within that chunk.
val chunk_indices : t -> int list -> int list listchunk_indices t shp returns a list of all chunk indices that would be contained in a zarr array of shape shp given the regular grid defined in array metadata t.
val chunk_key : t -> int list -> stringchunk_key t idx returns a key encoding of a the chunk index idx.
update_attributes t json returns a new metadata type with an updated attribute field containing contents in json
update_shape t new_shp returns a new metadata type containing shape new_shp.