anypytools.datautils.anydatah5_generator

anypytools.datautils.anydatah5_generator(folder=None, match='.*(\\.h5)')[source]

Create a generator which opens anydata.h5 files.

Parameters
  • folder (str, optional) – path of the directory to look for anydata.h5 files. Defaults is the current working directory

  • match (str) – regular expression to match with filenames. Default is to include file ending with .h5 ‘.*(.h5)’

Yields
  • h5py_file (array_like) – a h5_py file opened with anypytools.h5py_wrapper

  • filename (str) – name of the file from which the data was read

Examples

>>> for (h5, filename) in anydatah5_generator():
        print(h5)