Commit 6b0bebb9 authored by Theo Steininger's avatar Theo Steininger
Browse files

Fixed _to_hdf5 and _from_hdf5 in PowerSpace

parent 5b259cc2
Pipeline #12485 passed with stage
in 6 minutes and 6 seconds
......@@ -249,12 +249,12 @@ class PowerSpace(Space):
def _to_hdf5(self, hdf5_group):
hdf5_group['kindex'] = self.kindex
hdf5_group['rho'] = self.config["rho"]
hdf5_group['pundex'] = self.config["pundex"]
hdf5_group['rho'] = self.rho
hdf5_group['pundex'] = self.pundex
hdf5_group['logarithmic'] = self.config["logarithmic"]
# Store nbin as string, since it can be None
hdf5_group.attrs['nbin'] = str(self.nbin)
hdf5_group.attrs['binbounds'] = str(self.binbounds)
hdf5_group.attrs['nbin'] = str(self.config["nbin"])
hdf5_group.attrs['binbounds'] = str(self.config["binbounds"])
return {
'harmonic_partner': self.harmonic_partner,
......@@ -274,10 +274,10 @@ class PowerSpace(Space):
new_ps._harmonic_partner = repository.get('harmonic_partner',
hdf5_group)
new_ps.config = {}
new_ps.config['logarithmic'] = hdf5_group['logarithmic'][()]
exec("new_ps.config['nbin'] = " + hdf5_group.attrs['nbin'])
exec("new_ps.config['binbounds'] = " + hdf5_group.attrs['binbounds'])
new_ps._config = {}
new_ps._config['logarithmic'] = hdf5_group['logarithmic'][()]
exec("new_ps._config['nbin'] = " + hdf5_group.attrs['nbin'])
exec("new_ps._config['binbounds'] = " + hdf5_group.attrs['binbounds'])
new_ps._pindex = repository.get('pindex', hdf5_group)
new_ps._kindex = hdf5_group['kindex'][:]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment