This class implements a Zarr node. The node is an element in the hierarchy of the Zarr object. As per the Zarr specification, the node is either a group or an array. Thus, this class is the ancestor of the zarr_group and zarr_array classes. This class manages common features such as names, key, prefixes and paths, as well as the hierarchy between nodes and the zarr_store for persistent storage.
This class should never have to be instantiated or accessed directly.
Instead, use instances of zarr_group or zarr_array. Function arguments
are largely not checked, the group and array instances should do so prior
to calling methods here. The big exception is checking the validity of node
names.
Active bindings
name(read-only) The name of the node.
parent(read-only) The parent of the node. For a root node this returns
NULL, otherwise thiszarr_grouporzarr_arrayinstance.store(read-only) The store of the node.
path(read-only) The path of this node, relative to the root node of the hierarchy.
prefix(read-only) The prefix of this node, relative to the root node of the hierarchy.
metadata(read-only) The metadata document of this node, a list.
attributes(read-only) Retrieve the list of attributes of this object. Attributes can be added or modified with the
set_attribute()method or removed with thedelete_attributes()method.
Methods
Method new()
Initialize a new node in a Zarr hierarchy.
Usage
zarr_node$new(name, metadata, parent, store)Method print_attributes()
Print the metadata "attributes" to the console. Usually
called by the zarr_group and zarr_array print() methods.
Method set_attribute()
Add an attribute to the metadata of the object. If an
attribute name already exists, it will be overwritten.
Arguments
nameThe name of the attribute. The name must begin with a letter and be composed of letters, digits, and underscores, with a maximum length of 255 characters.
valueThe value of the attribute. This can be of any supported type, including a vector or list of values. In general, an attribute should be a character value, a numeric value, a logical value, or a short vector or list of any of these.
Method delete_attributes()
Delete attributes. If an attribute in name is not present
this method simply returns.