diff --git a/zarr/Zarr/Node/ArrayNode/index.html b/zarr/Zarr/Node/ArrayNode/index.html new file mode 100644 index 00000000..afb79d3e --- /dev/null +++ b/zarr/Zarr/Node/ArrayNode/index.html @@ -0,0 +1,2 @@ + +
Node.ArrayNode
val create : GroupNode.t -> string -> (t, [> error ]) Stdlib.result
create p n
returns an array node with parent p
and name n
or an error if this operation fails.
val (/) : GroupNode.t -> string -> (t, [> error ]) Stdlib.result
The infix operator alias of ArrayNode.create
of_path s
returns an array node from string s
or an error upon failure.
val to_path : t -> string
to_path n
returns array node n
as a string path.
val name : t -> string
name n
returns the name of array node n
.
val parent : t -> GroupNode.t
parent n
returns parent group node of n
.
val ancestors : t -> GroupNode.t list
ancestors n
returns ancestor group nodes of n
.
val is_parent : t -> GroupNode.t -> bool
is_parent n g
returns true
if group node g
is the immediate parent of array node n
and false
otherwise.
val to_key : t -> string
to_key n
converts a node's path to a key, as defined in the Zarr V3 specification.
val to_metakey : t -> string
to_prefix n
returns the metadata key associated with node n
, as defined in the Zarr V3 specification.
val show : t -> string
show n
returns a string representation of a node type.
val pp : Stdlib.Format.formatter -> t -> unit
pp fmt t
pretty prints a node type value.
Node.GroupNode
val root : t
creates the root node
create p n
returns a group node with parent p
and name n
or an error if this operation fails.
of_path s
returns a node from string s
or an error upon failure.
val to_path : t -> string
to_path n
returns node n
as a string path.
val name : t -> string
name n
returns the name of node n
. The root node does not have a name and thus the empty string ""
is returned if n
is a root node.
parent n
returns Some p
where p
is the parent node of n
of None
if node n
is the root node.
ancestors n
returns ancestor nodes of n
including the root node. The root node has no ancestors, thus this returns the empty list is called on a root node.
val to_key : t -> string
to_key n
converts a node's path to a key, as defined in the Zarr V3 specification.
val to_prefix : t -> string
to_prefix n
converts a node's path to a prefix key, as defined in the Zarr V3 specification.
val to_metakey : t -> string
to_prefix n
returns the metadata key associated with node n
, as defined in the Zarr V3 specification.
is_child_group m n
Tests if group node m
is a the immediate parent of group node n
. Returns true
when the test passes and false
otherwise.
val show : t -> string
show n
returns a string representation of a node type.
val pp : Stdlib.Format.formatter -> t -> unit
pp fmt t
pretty prints a node type value.
Zarr.Node
This module provides functionality for manipulating Zarr nodes.
A Zarr V3 node is associated with either a group or an array. All nodes in a hierarchy have a name and a path. The root node does not have a name and is the empty string "". Except for the root node, each node in a hierarchy must have a name, which is a string of unicode code points. The following constraints apply to node names:
val root : t
Returns the root node
create p n
returns a node with parent p
and name n
or an error of type error
if this operation fails.
The infix operator alias of Node.create
of_path s
returns a node from string s
or an error of type error
upon failure.
val to_path : t -> string
to_path n
returns node n
as a string path.
val name : t -> string
name n
returns the name of node n
. The root node does not have a name and thus the empty string ""
is returned if n
is a root node.
parent n
returns Some p
where p
is the parent node of n
of None
if node n
is the root node.
ancestors n
returns ancestor nodes of n
including the root node. The root node has no ancestors, thus this returns the empty list is called on a root node.
val to_key : t -> string
to_key n
converts a node's path to a key, as defined in the Zarr V3 specification.
val to_prefix : t -> string
to_prefix n
converts a node's path to a prefix key, as defined in the Zarr V3 specification.
val to_metakey : t -> string
to_prefix n
returns the metadata key associated with node n
, as defined in the Zarr V3 specification.
is_parent m n
Tests if node n
is a the immediate parent of node m
. Returns true
when the test passes and false
otherwise.
val show : t -> string
show n
returns a string representation of a node type.
val pp : Stdlib.Format.formatter -> t -> unit
pp fmt t
pretty prints a node type value.
Zarr.Node
This module provides functionality for manipulating Zarr nodes.
A Zarr V3 node is associated with either a group or an array. All nodes in a hierarchy have a name and a path. The root node does not have a name and is the empty string "". Except for the root node, each node in a hierarchy must have a name, which is a string of unicode code points. The following constraints apply to node names:
The error type for operations on node types. It is returned by functions that create an array or group node type when one or more of a node's invariants are not satisfied as defined in the Zarr V3 specification.
module GroupNode : sig ... end
module ArrayNode : sig ... end
Storage.FilesystemStore
A local filesystem storage backend for a Zarr V3 hierarchy.
include S
create_group ~meta t node
creates a group node in store t
containing metadata meta
. This is a no-op if a node node
is already a member of this store.
val create_array :
+ Node.GroupNode.t ->
+ unit
create_group ~meta t node
creates a group node in store t
containing metadata meta
. 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 ->
@@ -12,35 +12,37 @@
chunks:int array ->
('a, 'b) Stdlib.Bigarray.kind ->
'a ->
- Node.t ->
+ Node.ArrayNode.t ->
t ->
(unit, [> Codecs.error ]) Stdlib.result
create_array ~sep ~dimension_names ~attributes ~codecs ~shape ~chunks kind fill node t
creates an array node in store t
where:
sep
is used in the array's chunk key encoding.dimension_names
and user attributes attributes
are included in it's metadata document.codecs
.shape
and chunk shape chunks
.kind
and fill value fv
.This operation can fail if the codec chain is not well defined.
val array_metadata :
- Node.t ->
+ Node.ArrayNode.t ->
t ->
(Zarr__.Metadata.ArrayMetadata.t, [> Zarr__.Storage_intf.error ])
- Stdlib.result
array_metadata node t
returns the metadata of array node node
. This operation returns an error if:
t
.node
is a group node.val group_metadata :
- Node.t ->
+ Stdlib.result
array_metadata node t
returns the metadata of array node node
. This operation returns an error if node is not a member of store t
.
val group_metadata :
+ Node.GroupNode.t ->
t ->
(Zarr__.Metadata.GroupMetadata.t, [> Zarr__.Storage_intf.error ])
- Stdlib.result
group_metadata node t
returns the metadata of group node node
. This operation returns an error if:
t
.node
is an array node.group_metadata node t
returns the metadata of group node node
. This operation returns an error if node is not a member of store t
.
val find_child_nodes :
t ->
- Node.t ->
- (Node.t list * Node.t list, [> Zarr__.Storage_intf.error ]) Stdlib.result
find_child_nodes t n
returns a tuple of child nodes of group node n
. The first element of the tuple is a list of array child nodes, and the second element a list of child group nodes. This operation can fail if:
n
is not a member of store t
.n
is an array node of store t
.find_all_nodes t
returns a list of all nodes in store t
. If the store has no nodes, an empty list is returned.
erase_node t n
erases node n
from store t
. This function erases all child nodes if n
is a group node. If node n
is not a member of store t
then this is a no-op.
is_member t n
returns true
if node n
is a member of store t
and false
otherwise.
val set_array :
- Node.t ->
+ Node.GroupNode.t ->
+ (Node.ArrayNode.t list * Node.GroupNode.t list,
+ [> Zarr__.Storage_intf.error ])
+ Stdlib.result
find_child_nodes t n
returns a tuple of child nodes of group node n
. This operation can fail if n
is not a member of store t
.
val find_all_nodes : t -> Node.ArrayNode.t list * Node.GroupNode.t list
find_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. If the store has no nodes, None
is returned.
val erase_group_node : t -> Node.GroupNode.t -> unit
erase_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 -> Node.ArrayNode.t -> unit
erase_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 group_exists : t -> Node.GroupNode.t -> bool
group_exists t n
returns true
if group node n
is a member of store t
and false
otherwise.
val array_exists : t -> Node.ArrayNode.t -> bool
array_exists t n
returns true
if array node n
is a member of store t
and false
otherwise.
val set_array :
+ Node.ArrayNode.t ->
Owl_types.index array ->
('a, 'b) Zarr__.Storage_intf.Ndarray.t ->
t ->
(unit, [> Zarr__.Storage_intf.error ]) Stdlib.result
set_array n s x t
writes n-dimensional array x
to the slice s
of array node n
in store t
. This operation fails if:
x
size does not equal slice s
.x
is not compatible with node n
's data type as described in its metadata document.n
chunks.val get_array :
- Node.t ->
+ Node.ArrayNode.t ->
Owl_types.index array ->
('a, 'b) Stdlib.Bigarray.kind ->
t ->
(('a, 'b) Zarr__.Storage_intf.Ndarray.t, [> Zarr__.Storage_intf.error ])
Stdlib.result
get_array n s k t
reads an n-dimensional array of size determined by slice s
from array node n
. This operation fails if:
n
chunks.k
is not compatible with node n
's data type as described in its metadata document.s
is not a valid slice of array node n
.val reshape :
t ->
- Node.t ->
+ Node.ArrayNode.t ->
int array ->
- (unit, [> Zarr__.Storage_intf.error ]) Stdlib.result
reshape t n shape
resizes array node n
of store t
into new size shape
. If this operation fails, an error is returned. It can fail if:
n
is not a valid array node.shape
does not have the same dimensions as node n
's shape.val create : ?file_perm:Unix.file_perm -> string -> t
create ~file_perm path
returns a new filesystem Zarr V3 store. This * operatioin fails if path
is a directory that already exists.
reshape t n shape
resizes array node n
of store t
into new size shape
. If this operation fails, an error is returned. It can fail if shape
does not have the same dimensions as n
's shape. If node n
is not a member of store t
then this is a no-op.
val create : ?file_perm:Unix.file_perm -> string -> t
create ~file_perm path
returns a new filesystem Zarr V3 store. This * operatioin fails if path
is a directory that already exists.
open_store ~file_perm path
returns an existing filesystem Zarr V3 store. * This operatioin fails if path
is not a Zarr store path.
val open_or_create :
diff --git a/zarr/Zarr/Storage/Make/index.html b/zarr/Zarr/Storage/Make/index.html
index c4bd6c1b..2ec86f4d 100644
--- a/zarr/Zarr/Storage/Make/index.html
+++ b/zarr/Zarr/Storage/Make/index.html
@@ -2,8 +2,8 @@
Make (zarr.Zarr.Storage.Make) Module Storage.Make
A functor for minting a new storage type as long as it's argument module implements the STORE
interface.
Parameters
module M : sig ... end
Signature
type t = M.t
The storage type.
create_group ~meta t node
creates a group node in store t
containing metadata meta
. This is a no-op if a node node
is already a member of this store.
val create_array :
+ Node.GroupNode.t ->
+ unit
create_group ~meta t node
creates a group node in store t
containing metadata meta
. 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 ->
@@ -12,32 +12,34 @@
chunks:int array ->
('a, 'b) Stdlib.Bigarray.kind ->
'a ->
- Node.t ->
+ Node.ArrayNode.t ->
t ->
(unit, [> Codecs.error ]) Stdlib.result
create_array ~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
.
This operation can fail if the codec chain is not well defined.
val array_metadata :
- Node.t ->
+ Node.ArrayNode.t ->
t ->
(Zarr__.Metadata.ArrayMetadata.t, [> Zarr__.Storage_intf.error ])
- Stdlib.result
array_metadata node t
returns the metadata of array node node
. This operation returns an error if:
- The node is not a member of store
t
. - if node
node
is a group node.
val group_metadata :
- Node.t ->
+ Stdlib.result
array_metadata node t
returns the metadata of array node node
. This operation returns an error if node is not a member of store t
.
val group_metadata :
+ Node.GroupNode.t ->
t ->
(Zarr__.Metadata.GroupMetadata.t, [> Zarr__.Storage_intf.error ])
- Stdlib.result
group_metadata node t
returns the metadata of group node node
. This operation returns an error if:
- The node is not a member of store
t
. - if node
node
is an array node.
group_metadata node t
returns the metadata of group node node
. This operation returns an error if node is not a member of store t
.
val find_child_nodes :
t ->
- Node.t ->
- (Node.t list * Node.t list, [> Zarr__.Storage_intf.error ]) Stdlib.result
find_child_nodes t n
returns a tuple of child nodes of group node n
. The first element of the tuple is a list of array child nodes, and the second element a list of child group nodes. This operation can fail if:
- Node
n
is not a member of store t
. - Node
n
is an array node of store t
.
find_all_nodes t
returns a list of all nodes in store t
. If the store has no nodes, an empty list is returned.
erase_node t n
erases node n
from store t
. This function erases all child nodes if n
is a group node. If node n
is not a member of store t
then this is a no-op.
is_member t n
returns true
if node n
is a member of store t
and false
otherwise.
val set_array :
- Node.t ->
+ Node.GroupNode.t ->
+ (Node.ArrayNode.t list * Node.GroupNode.t list,
+ [> Zarr__.Storage_intf.error ])
+ Stdlib.result
find_child_nodes t n
returns a tuple of child nodes of group node n
. This operation can fail if n
is not a member of store t
.
val find_all_nodes : t -> Node.ArrayNode.t list * Node.GroupNode.t list
find_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. If the store has no nodes, None
is returned.
val erase_group_node : t -> Node.GroupNode.t -> unit
erase_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 -> Node.ArrayNode.t -> unit
erase_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 group_exists : t -> Node.GroupNode.t -> bool
group_exists t n
returns true
if group node n
is a member of store t
and false
otherwise.
val array_exists : t -> Node.ArrayNode.t -> bool
array_exists t n
returns true
if array node n
is a member of store t
and false
otherwise.
val set_array :
+ Node.ArrayNode.t ->
Owl_types.index array ->
('a, 'b) Zarr__.Storage_intf.Ndarray.t ->
t ->
(unit, [> Zarr__.Storage_intf.error ]) Stdlib.result
set_array n s x t
writes n-dimensional array x
to the slice s
of array node n
in store t
. This operation fails if:
- the ndarray
x
size does not equal slice s
. - the kind of
x
is not compatible with node n
's data type as described in its metadata document. - If there is a problem decoding/encoding node
n
chunks.
val get_array :
- Node.t ->
+ Node.ArrayNode.t ->
Owl_types.index array ->
('a, 'b) Stdlib.Bigarray.kind ->
t ->
(('a, 'b) Zarr__.Storage_intf.Ndarray.t, [> Zarr__.Storage_intf.error ])
Stdlib.result
get_array n s k t
reads an n-dimensional array of size determined by slice s
from array node n
. This operation fails if:
- If there is a problem decoding/encoding node
n
chunks. - kind
k
is not compatible with node n
's data type as described in its metadata document. - The slice
s
is not a valid slice of array node n
.
val reshape :
t ->
- Node.t ->
+ Node.ArrayNode.t ->
int array ->
- (unit, [> Zarr__.Storage_intf.error ]) Stdlib.result
reshape t n shape
resizes array node n
of store t
into new size shape
. If this operation fails, an error is returned. It can fail if:
- Node
n
is not a valid array node. - If
shape
does not have the same dimensions as node n
's shape.
+ (unit, [> Zarr__.Storage_intf.error ]) Stdlib.result
reshape t n shape
resizes array node n
of store t
into new size shape
. If this operation fails, an error is returned. It can fail if shape
does not have the same dimensions as n
's shape. If node n
is not a member of store t
then this is a no-op.
Storage.MemoryStore
An in-memory storage backend for Zarr V3 hierarchy.
include S
create_group ~meta t node
creates a group node in store t
containing metadata meta
. This is a no-op if a node node
is already a member of this store.
val create_array :
+ Node.GroupNode.t ->
+ unit
create_group ~meta t node
creates a group node in store t
containing metadata meta
. 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 ->
@@ -12,32 +12,34 @@
chunks:int array ->
('a, 'b) Stdlib.Bigarray.kind ->
'a ->
- Node.t ->
+ Node.ArrayNode.t ->
t ->
(unit, [> Codecs.error ]) Stdlib.result
create_array ~sep ~dimension_names ~attributes ~codecs ~shape ~chunks kind fill node t
creates an array node in store t
where:
sep
is used in the array's chunk key encoding.dimension_names
and user attributes attributes
are included in it's metadata document.codecs
.shape
and chunk shape chunks
.kind
and fill value fv
.This operation can fail if the codec chain is not well defined.
val array_metadata :
- Node.t ->
+ Node.ArrayNode.t ->
t ->
(Zarr__.Metadata.ArrayMetadata.t, [> Zarr__.Storage_intf.error ])
- Stdlib.result
array_metadata node t
returns the metadata of array node node
. This operation returns an error if:
t
.node
is a group node.val group_metadata :
- Node.t ->
+ Stdlib.result
array_metadata node t
returns the metadata of array node node
. This operation returns an error if node is not a member of store t
.
val group_metadata :
+ Node.GroupNode.t ->
t ->
(Zarr__.Metadata.GroupMetadata.t, [> Zarr__.Storage_intf.error ])
- Stdlib.result
group_metadata node t
returns the metadata of group node node
. This operation returns an error if:
t
.node
is an array node.group_metadata node t
returns the metadata of group node node
. This operation returns an error if node is not a member of store t
.
val find_child_nodes :
t ->
- Node.t ->
- (Node.t list * Node.t list, [> Zarr__.Storage_intf.error ]) Stdlib.result
find_child_nodes t n
returns a tuple of child nodes of group node n
. The first element of the tuple is a list of array child nodes, and the second element a list of child group nodes. This operation can fail if:
n
is not a member of store t
.n
is an array node of store t
.find_all_nodes t
returns a list of all nodes in store t
. If the store has no nodes, an empty list is returned.
erase_node t n
erases node n
from store t
. This function erases all child nodes if n
is a group node. If node n
is not a member of store t
then this is a no-op.
is_member t n
returns true
if node n
is a member of store t
and false
otherwise.
val set_array :
- Node.t ->
+ Node.GroupNode.t ->
+ (Node.ArrayNode.t list * Node.GroupNode.t list,
+ [> Zarr__.Storage_intf.error ])
+ Stdlib.result
find_child_nodes t n
returns a tuple of child nodes of group node n
. This operation can fail if n
is not a member of store t
.
val find_all_nodes : t -> Node.ArrayNode.t list * Node.GroupNode.t list
find_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. If the store has no nodes, None
is returned.
val erase_group_node : t -> Node.GroupNode.t -> unit
erase_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 -> Node.ArrayNode.t -> unit
erase_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 group_exists : t -> Node.GroupNode.t -> bool
group_exists t n
returns true
if group node n
is a member of store t
and false
otherwise.
val array_exists : t -> Node.ArrayNode.t -> bool
array_exists t n
returns true
if array node n
is a member of store t
and false
otherwise.
val set_array :
+ Node.ArrayNode.t ->
Owl_types.index array ->
('a, 'b) Zarr__.Storage_intf.Ndarray.t ->
t ->
(unit, [> Zarr__.Storage_intf.error ]) Stdlib.result
set_array n s x t
writes n-dimensional array x
to the slice s
of array node n
in store t
. This operation fails if:
x
size does not equal slice s
.x
is not compatible with node n
's data type as described in its metadata document.n
chunks.val get_array :
- Node.t ->
+ Node.ArrayNode.t ->
Owl_types.index array ->
('a, 'b) Stdlib.Bigarray.kind ->
t ->
(('a, 'b) Zarr__.Storage_intf.Ndarray.t, [> Zarr__.Storage_intf.error ])
Stdlib.result
get_array n s k t
reads an n-dimensional array of size determined by slice s
from array node n
. This operation fails if:
n
chunks.k
is not compatible with node n
's data type as described in its metadata document.s
is not a valid slice of array node n
.val reshape :
t ->
- Node.t ->
+ Node.ArrayNode.t ->
int array ->
- (unit, [> Zarr__.Storage_intf.error ]) Stdlib.result
reshape t n shape
resizes array node n
of store t
into new size shape
. If this operation fails, an error is returned. It can fail if:
n
is not a valid array node.shape
does not have the same dimensions as node n
's shape.val create : unit -> t
create ()
returns a new In-memory Zarr V3 store.
reshape t n shape
resizes array node n
of store t
into new size shape
. If this operation fails, an error is returned. It can fail if shape
does not have the same dimensions as n
's shape. If node n
is not a member of store t
then this is a no-op.
val create : unit -> t
create ()
returns a new In-memory Zarr V3 store.