def root_group(h5Dataset):
    """ Calls HDF5 groups parent recursively until HDF5 group parent is '/'

    :param h5Dataset: HDF5 to from which search must start
    :return: HDF5 root group (i.e. if h5Dataset is /path/to/dataset, it returns /path h5py Group)
    """
    root = h5Dataset.parent
    while root.parent.name != '/':
        root = root.parent
    return root
