3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-25 22:03:43 +01:00

Fix missing cached key in archives

When an object with __hdf_write__ was written in an archive, the
corresponding key was not cached. Therefore, one could not access
the object which had just been written.
This commit is contained in:
Michel Ferrero 2013-12-23 13:15:27 +01:00
parent 8cc5012347
commit 15f0899016

View File

@ -184,6 +184,7 @@ class HDFArchiveGroup (HDFArchiveGroupBasicLayer) :
if '__write_hdf5__' in dir(val) : # simplest protocol if '__write_hdf5__' in dir(val) : # simplest protocol
val.__write_hdf5__(self._group,key) val.__write_hdf5__(self._group,key)
self.cached_keys.append(key) # I need to do this here
SUB = HDFArchiveGroup(self,key) SUB = HDFArchiveGroup(self,key)
write_attributes(SUB) write_attributes(SUB)
elif '__reduce_to_dict__' in dir(val) : # Is it a HDF_compliant object elif '__reduce_to_dict__' in dir(val) : # Is it a HDF_compliant object