How to use the anypytools.h5py_wrapper.File 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 / anypytools / h5py_wrapper.py View on Github external
levels = path.strip('/').split('/')
            for level in levels:
                if elem.__contains__(level):
                    elem = elem.__getitem__(level)
                else:
                    try:
                        elem = _follow_reftarget(elem)
                        elem = elem.__getitem__(level)
                    except Exception:
                        raise KeyError('Entry not found: ' + path)
        if isinstance(elem, h5py.Group):
            return Group(elem.id)
        elif isinstance(elem, h5py.Dataset):
            return Dataset(elem.id)
        elif isinstance(elem, h5py.File):
            return File(elem.id)
github AnyBody-Research-Group / AnyPyTools / anypytools / h5py_wrapper.py View on Github external
levels = path.strip('/').split('/')
            for level in levels:
                if elem.__contains__(level):
                    elem = elem.__getitem__(level)
                else:
                    try:
                        elem = _follow_reftarget(elem)
                        elem = elem.__getitem__(level)
                    except Exception:
                        raise KeyError('Entry not found: ' + path)
        if isinstance(elem, h5py.Group):
            return Group(elem.id)
        elif isinstance(elem, h5py.Dataset):
            return Dataset(elem.id)
        elif isinstance(elem, h5py.File):
            return File(elem.id)
github AnyBody-Research-Group / AnyPyTools / anypytools / h5py_wrapper.py View on Github external
def __contains__(self, name): # noqa
        """ Test if a member name exists """
        if super(File, self).__contains__(name):
            return True
        else:
            try:
                self.__getitem__(name)
                return True
            except KeyError:
                pass
        return False
github AnyBody-Research-Group / AnyPyTools / anypytools / h5py_wrapper.py View on Github external
def file(self): # noqa
        id = super(File, self).file.id
        return File(id)