def load_memory_state(self, projectinfo_file): """ Loads the 'memory state' from a serialized file on disk Parameters ---------- projectinfo_file : str The file on disk from which to read. Notes ----- When reading the memory state, we have to decode base16, and also remove leading 'a' characters See Also -------- save_memory_state """ logger.info("Loading memory state from: %s", projectinfo_file) project_info = Project.load_from_hdf( projectinfo_file ) self.memory = cPickle.loads( project_info["Memory"] ) return
def load_memory_state(self, projectinfo_file): """ Loads the 'memory state' from a serialized file on disk Parameters ---------- projectinfo_file : str The file on disk from which to read. Notes ----- When reading the memory state, we have to decode base16, and also remove leading 'a' characters See Also -------- save_memory_state """ logger.info("Loading memory state from: %s", projectinfo_file) project_info = Project.load_from_hdf(projectinfo_file) self.memory = cPickle.loads(project_info["Memory"]) return
def save_memory_state(self): """ Saves the 'memory state' to disk in a serialized format. Notes ----- When saving, we encode the keys into base16 with a leading 'a', because the HDF5 Serializer doesnt' like '/' characters and is super picky in general See Also -------- load_memory_state """ project_info = Project.load_from_hdf( projectinfo_file ) project_info["Memory"] = cPickle.dumps( self.memory ) project_info.save_to_hdf( projectinfo_file, do_file_check=False ) return
def save_memory_state(self): """ Saves the 'memory state' to disk in a serialized format. Notes ----- When saving, we encode the keys into base16 with a leading 'a', because the HDF5 Serializer doesnt' like '/' characters and is super picky in general See Also -------- load_memory_state """ project_info = Project.load_from_hdf(projectinfo_file) project_info["Memory"] = cPickle.dumps(self.memory) project_info.save_to_hdf(projectinfo_file, do_file_check=False) return