def add_data(self, group, name, data):
        if self.isgroup(data):
            g = self.add_h5group(group, name,
                                 attrs={'larchtype': 'group',
                                        'class': data.__class__.__name__})
            for comp in dir(data):
                self.add_data(g, comp, getattr(data, comp))
        elif isinstance(data, (list, tuple)):
            dtype = 'list'
            if isinstance(data, tuple): dtype = 'tuple'
            g = self.add_h5group(group, name, attrs={'larchtype': dtype})
            for ix, comp in enumerate(data):
                iname = 'item%i' % ix
                self.add_data(g, iname, comp)
        elif isinstance(data, dict):
            g = self.add_h5group(group, name, attrs={'larchtype': 'dict'})
            for key, val in data.items():
                self.add_data(g, key, val)
        elif isParameter(data):
            g = self.add_h5group(group, name, attrs={'larchtype': 'parameter'})
            self.add_h5dataset(g, 'json', data.asjson())
        else:
            d = self.add_h5dataset(group, name, data)
dataset/ETHPy150Open xraypy/xraylarch/plugins/io/save_restore.py/H5PySaveFile.add_data/original