package zarr

  1. Overview
  2. Docs

A module containing functions to encode/decode an array chunk using a predefined set of codecs.

type t

A type representing a valid chain of codecs for decoding/encoding a Zarr array chunk.

val create : int array -> codec_chain -> t

create s c returns a type representing a chain of codecs defined by chain c and chunk shape s.

  • raises Bytes_to_bytes_invariant

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

val encode : t -> 'a Ndarray.t -> string

encode t x computes the encoded byte string representation of array chunk x.

val decode : t -> 'a array_repr -> string -> 'a Ndarray.t

decode t repr x decodes the byte string x using codec chain t and decoded representation type repr.

val (=) : t -> t -> bool

x = y returns true if chain x is equal to chain y, and false otherwise.

val of_yojson : int array -> Yojson.Safe.t -> (t, string) result

of_yojson x returns a code chain of type t from its json object representation.

val to_yojson : t -> Yojson.Safe.t

to_yojson x returns a json object representation of codec chain x.

OCaml

Innovation. Community. Security.