def add_h5dataset(self, group, name, data, attrs=None, **kws):
        """creata an hdf5 dataset"""
        kwargs = {}
        if isinstance(data, np.ndarray):
            kwargs = {'compression':4}
        kwargs.update(kws)
        try:
            d = group.create_dataset(name, data=data, **kwargs)
        except __HOLE__:
            d = group.create_dataset(name, data=repr(data), **kwargs)
        if isinstance(attrs, dict):
            for key, val in attrs.items():
                d.attrs[key] = val
        return d
dataset/ETHPy150Open xraypy/xraylarch/plugins/io/save_restore.py/H5PySaveFile.add_h5dataset