allensdk.core.h5_utilities module

allensdk.core.h5_utilities.decode_bytes(bytes_dataset, encoding='UTF-8')[source]

Convert the elements of a dataset of bytes to str

allensdk.core.h5_utilities.h5_object_matcher_relname_in(relnames, h5_object_name, h5_object)[source]

Asks if an h5 object’s relative name (the final section of its absolute name) is contained within a provided array

Parameters:
relnamesarray-like

Relative names against which to match

h5_object_namestr

Full name (path from origin) of h5 object

h5_objecth5py.Group, h5py.Dataset

Check this object’s relative name

Returns:
bool

whether the match succeeded

h5_objecth5py.group, h5py.Dataset

the argued object

allensdk.core.h5_utilities.keyed_locate_h5_objects(matcher_cbs, h5_file, start_node=None)[source]

Traverse an h5 file and build up a dictionary mapping supplied keys to located objects

allensdk.core.h5_utilities.load_datasets_by_relnames(relnames, h5_file, start_node)[source]

A convenience function for finding and loading into memory one or more datasets from an h5 file

allensdk.core.h5_utilities.locate_h5_objects(matcher_cb, h5_file, start_node=None)[source]

Traverse an h5 file and return objects matching supplied criteria

allensdk.core.h5_utilities.traverse_h5_file(callback, h5_file, start_node=None)[source]

Traverse an h5 file and apply a callback to each node