How to use the anypytools.h5py_wrapper function in anypytools

To help you get started, we’ve selected a few anypytools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AnyBody-Research-Group / AnyPyTools / tests / test_h5py_wrapper.py View on Github external
def test_group():
    with h5py_wrapper.File(h5test_file) as f:
        h5group = f['/Output']
        t1 = h5group['MomentArm'] # Standard h5py notation
        t2 = h5group['Model/Knee/Pos']
        t3 = h5group['Model.Knee.Pos']
github AnyBody-Research-Group / AnyPyTools / tests / test_h5py_wrapper.py View on Github external
def test_file():
    with h5py_wrapper.File(h5test_file) as f:
        t1 = f['/Output/MomentArm'] # Standard h5py notation
        t2 = f['Output.MomentArm']  # dot notation
        t3 = f['Main.MyStudy.Output.Model.Knee.Pos'] # dot notation with full path
github AnyBody-Research-Group / AnyPyTools / anypytools / datautils.py View on Github external
Examples
    --------
    >>> for (h5, filename) in anydatah5_generator():
            print(h5)

    """
    from . import h5py_wrapper
    if folder is None:
        folder = str(os.getcwd())

    def func(item):
        return re.match(item, match, flags=re.IGNORECASE)
    filelist = filter(func, os.listdir(folder))
    for filename in filelist:
        try:
            with h5py_wrapper.File(op.join(folder, filename)) as h5file:
                yield (h5file, filename)
        except IOError:
            pass