chihaya-utils: Developer utilities for custom extensions

chihaya-utilsR Documentation

Developer utilities for custom extensions

Description

Convenience utilities for extending the chihaya format with “custom” seeds or operations. These should only be used by package developers.

Usage

.saveList(file, name, x, parent = NULL, vectors.only = FALSE)

.loadList(file, name, parent = NULL, vectors.only = FALSE)

.labelOperationGroup(file, name, op)

.labelArrayGroup(file, name, arr)

.saveDataset(
  file,
  name,
  x,
  parent = NULL,
  scalar = FALSE,
  optimize.type = FALSE,
  h5type = NULL,
  chunks = NULL
)

.pickArrayType(x)

Arguments

file

String containing a path to a file.

name

String containing the name of the object inside the file. This should be a full path from the root of the file, unless parent is provided, in which case it may be the name of the child.

x

The object to save.

  • For .pickArrayType, this should be an array-like object.

  • For .saveList, this should be a list.

  • For .saveDataset, this should be a integer, logical, character or double vector or array.

parent

String containing the name of the parent containing the child name.

vectors.only

Logical scalar indicating whether elements of x should be saved and loaded as 1-d arrays rather than seeds.

op

String containing the name of the delayed operation to use to label the group.

arr

String containing the name of the delayed array to use to label the group.

scalar

Logical scalar indicating whether length-1 x should be saved to file as a scalar.

optimize.type

Logical scalar indicating whether to optimize the HDF5 storage type for non-scalar, non-string x.

h5type

String specifying the HDF5 storage type to use for non-scalar, non-string x, see h5const("H5T") for possible choices. This is ignored if optimize.type=TRUE.

chunks

Integer vector of length equal to the number of dimensions of non-scalar x, specifying the chunk dimensions to use. If NULL, this is set to the length of x (if x is a vector) or chosen by HDF5Array (if x is an array).

Value

.saveList and .saveScalar will write x to file, returning NULL invisibly.

.labelArrayGroup and .labelOperationGroup will apply the label to the specified group, returning NULL invisibly.

.loadList will return a list containing the contents of name. This is guaranteed to contain only vectors (or fail) if vectors.only=TRUE.

.pickArrayType will return a string containing the chihaya type for an array-like x.

Author(s)

Aaron Lun


LTLA/DelayedArraySaver documentation built on Oct. 11, 2023, 1:33 p.m.