From 15f0899016609dfbc804204ce5bcda466a0eb1be Mon Sep 17 00:00:00 2001 From: Michel Ferrero Date: Mon, 23 Dec 2013 13:15:27 +0100 Subject: [PATCH] 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. --- pytriqs/archive/hdf_archive.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pytriqs/archive/hdf_archive.py b/pytriqs/archive/hdf_archive.py index 5a7d41bc..dfc70d8f 100644 --- a/pytriqs/archive/hdf_archive.py +++ b/pytriqs/archive/hdf_archive.py @@ -184,6 +184,7 @@ class HDFArchiveGroup (HDFArchiveGroupBasicLayer) : if '__write_hdf5__' in dir(val) : # simplest protocol val.__write_hdf5__(self._group,key) + self.cached_keys.append(key) # I need to do this here SUB = HDFArchiveGroup(self,key) write_attributes(SUB) elif '__reduce_to_dict__' in dir(val) : # Is it a HDF_compliant object