chihaya
Validating delayed array operations in HDF5
Loading...
Searching...
No Matches
chihaya Namespace Reference

Namespace for all chihaya functions. More...

Classes

struct  ArrayDetails
 Details about an array. More...
 
struct  Options
 Options for validate(). More...
 

Typedefs

typedef std::unordered_map< std::string, std::function< ArrayDetails(const H5::Group &, const ritsuko::Version &, const Options &)> > ValidateRegistry
 

Enumerations

enum  ArrayType { BOOLEAN = 0 , INTEGER = 1 , FLOAT = 2 , STRING = 3 }
 

Functions

ArrayDetails validate_binary_arithmetic (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_binary_comparison (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_binary_logic (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_combine (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_constant_array (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_custom_array (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_dense_array (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_dimnames (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_external_hdf5 (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_matrix_product (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_sparse_matrix (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_subset (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_subset_assignment (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_transpose (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_unary_arithmetic (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_unary_comparison (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_unary_logic (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_unary_math (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate_unary_special_check (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ArrayDetails validate (const H5::Group &group, const ritsuko::Version &version, const Options &options)
 
ritsuko::Version extract_version (const H5::Group &group)
 
ArrayDetails validate (const H5::Group &group, const Options &options)
 
ArrayDetails validate (const std::string &path, const std::string &name, const Options &options)
 
ArrayDetails validate (const std::string &path, const std::string &name)
 

Detailed Description

Namespace for all chihaya functions.

Typedef Documentation

◆ ValidateRegistry

typedef std::unordered_map<std::string, std::function<ArrayDetails(const H5::Group&, const ritsuko::Version&, const Options&)> > chihaya::ValidateRegistry

Type of the registry of validation functions. Each key is the name of a delayed array/operation and each value is a validation function. See validate() for more details on the expected arguments and return type.

Enumeration Type Documentation

◆ ArrayType

Type of the array. Operations involving mixed types will generally result in promotion to the more advanced types, e.g., an INTEGER and FLOAT addition will result in promotion to FLOAT. Note that operations involving the same types are not guaranteed to preserve type, e.g., INTEGER division is assumed to produce a FLOAT.

Function Documentation

◆ extract_version()

ritsuko::Version chihaya::extract_version ( const H5::Group & group)
inline

The version is taken from the delayed_version attribute of the group. This should be a version string of the form <MAJOR>.<MINOR>. For back-compatibility purposes, the string "1.0.0" is also allowed, corresponding to version 1.0; and if delayed_version is missing, it defaults to 0.99.

Parameters
groupHDF5 group corresponding to a delayed operation or array.
Returns
Version of the chihaya specification.

◆ validate() [1/4]

ArrayDetails chihaya::validate ( const H5::Group & group,
const Options & options )
inline

Overload of validate() that extracts the version from group via extract_version().

Parameters
groupHDF5 group representing a delayed operation or array.
optionsValidation options, see validate() for details.
Returns
Details of the array after all delayed operations in group (and its children) have been applied.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate() [2/4]

ArrayDetails chihaya::validate ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline

Validate a HDF5 group representing a delayed oepration or array. For operations, this function will first search Options::operation_validate_registry for an available validation function. For arrays, this function will first search Options::array_validate_registry for an available validation function.

Parameters
groupHDF5 group representing a delayed operation or array.
versionVersion of the chihaya specification.
optionsValidation options, possibly containing custom validation functions.
Returns
Details of the array after all delayed operations in group (and its children) have been applied.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate() [3/4]

ArrayDetails chihaya::validate ( const std::string & path,
const std::string & name )
inline

Overload of validate() that accepts a file path and group name, and uses the default Options.

Parameters
pathPath to a HDF5 file.
nameName of the HDF5 group inside the file representing a delayed operation or array.
Returns
Details of the array after all delayed operations have been applied.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate() [4/4]

ArrayDetails chihaya::validate ( const std::string & path,
const std::string & name,
const Options & options )
inline

Overload of validate() that accepts a file path and group name.

Parameters
pathPath to a HDF5 file.
nameName of the HDF5 group inside the file representing a delayed operation or array.
optionsValidation options, see validate() for details.
Returns
Details of the array after all delayed operations have been applied.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_binary_arithmetic()

ArrayDetails chihaya::validate_binary_arithmetic ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a binary arithmetic operation.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the object after applying the arithmetic operation.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_binary_comparison()

ArrayDetails chihaya::validate_binary_comparison ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a binary comparison.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the object after applying the comparison operation.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_binary_logic()

ArrayDetails chihaya::validate_binary_logic ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a binary logical operation.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the object after applying the logical operation.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_combine()

ArrayDetails chihaya::validate_combine ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a combining operation.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the combined object.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_constant_array()

ArrayDetails chihaya::validate_constant_array ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a constant array.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the constant array.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_custom_array()

ArrayDetails chihaya::validate_custom_array ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a custom array.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the custom array.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_dense_array()

ArrayDetails chihaya::validate_dense_array ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a dense array.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the dense array.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_dimnames()

ArrayDetails chihaya::validate_dimnames ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a dimnames assignment operation.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the object after assigning dimnames.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_external_hdf5()

ArrayDetails chihaya::validate_external_hdf5 ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing an external HDF5 array.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the external HDF5 array.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_matrix_product()

ArrayDetails chihaya::validate_matrix_product ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a matrix product.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the matrix product.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_sparse_matrix()

ArrayDetails chihaya::validate_sparse_matrix ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a sparse matrix.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the sparse matrix.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_subset()

ArrayDetails chihaya::validate_subset ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a subset operation.
versionVerison of the chihaya specification.
optionsValidation options.
Returns
Details of the subsetted object.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_subset_assignment()

ArrayDetails chihaya::validate_subset_assignment ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a subset assignment.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the object after subset assignment.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_transpose()

ArrayDetails chihaya::validate_transpose ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing a transposition.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the transposed object.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_unary_arithmetic()

ArrayDetails chihaya::validate_unary_arithmetic ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing an unary arithmetic operation.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the object after applying the arithmetic operation.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_unary_comparison()

ArrayDetails chihaya::validate_unary_comparison ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing an unary comparison operation.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the object after applying the comparison operation.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_unary_logic()

ArrayDetails chihaya::validate_unary_logic ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing an unary logic operation.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the object after applying the logical operation.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_unary_math()

ArrayDetails chihaya::validate_unary_math ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing an unary math operation.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the object after applying the math operation.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.

◆ validate_unary_special_check()

ArrayDetails chihaya::validate_unary_special_check ( const H5::Group & group,
const ritsuko::Version & version,
const Options & options )
inline
Parameters
groupHDF5 group representing an unary special check operation.
versionVersion of the chihaya specification.
optionsValidation options.
Returns
Details of the object after applying the special check.
Exceptions
H5::ExceptionThrown upon HDF5 library error. This may be wrapped in a std::nested_exception.
std::exceptionThrown upon validation failure. This may be a std::nested_exception, in which case the nested exceptions should be extracted to obtain an informative error message.