package zarr

  1. Overview
  2. Docs
type _ dtype =
  1. | Char : char dtype
  2. | Int8 : int dtype
  3. | Uint8 : int dtype
  4. | Int16 : int dtype
  5. | Uint16 : int dtype
  6. | Int32 : int32 dtype
  7. | Int64 : int64 dtype
  8. | Uint64 : Stdint.uint64 dtype
  9. | Float32 : float dtype
  10. | Float64 : float dtype
  11. | Complex32 : Complex.t dtype
  12. | Complex64 : Complex.t dtype
  13. | Int : int dtype
  14. | Nativeint : nativeint dtype

Supported data types for a Zarr array.

type 'a t

The type for n-dimensional view of a Zarr array.

val dtype_size : 'a dtype -> int

dtype_size kind returns the size in bytes of data type kind.

val create : 'a dtype -> int array -> 'a -> 'a t

create k s v creates an N-dimensional array with data_type k, shape s and fill value v.

val init : 'a dtype -> int array -> (int -> 'a) -> 'a t

init k s f creates an N-dimensional array with data_type k, shape s and every element value is assigned using function f.

val data_type : 'a t -> 'a dtype

data_type x returns the data_type associated with x.

val size : 'a t -> int

size x is the total number of elements of x.

val ndims : 'a t -> int

ndims x is the number of dimensions of x.

val shape : 'a t -> int array

shape x returns an array with the size of each dimension of x.

val byte_size : 'a t -> int

byte_size x is the total size occupied by the byte sequence of elements of x.

val to_array : 'a t -> 'a array

to_array x returns the data of x as a 1-d array of type determined by data_type. Note that data is not copied, so if the caller modifies the returned array, the changes will be reflected in x.

val of_array : 'a dtype -> int array -> 'a array -> 'a t

of_array k s x creates an n-dimensional array of shape s and data_type k using elements of x. Note that the data is not copied, so the caller must ensure not to modify x afterwards.

val get : 'a t -> int array -> 'a

get x c returns element of x at coordinate c.

val set : 'a t -> int array -> 'a -> unit

set x c v sets coordinate c of x to value v.

val iteri : (int -> 'a -> unit) -> 'a t -> unit

Same as iter but the function is applied to the index of the element as first argument and the element value as the second.

val fill : 'a t -> 'a -> unit

fill x v replaces all elements of x with value v.

val map : ('a -> 'a) -> 'a t -> 'a t

map f x applies function f to all elements of x and builds an n-dimensional array of same shape and data_type as x with the result.

val iter : ('a -> unit) -> 'a t -> unit

iteri f x applies function f to all elements of x in row-major order.

val equal : 'a t -> 'a t -> bool

equal x y is true iff x and y are equal, else false.

val transpose : ?axis:int array -> 'a t -> 'a t

transpose o x permutes the axes of x according to o.

module Indexing : sig ... end

A module housing functions for creating and manipulating indices and slices for working with Zarr arrays.

OCaml

Innovation. Community. Security.