Ejemplo n.º 1
0
def write_to_tmp(name, pid, results):
    """ Save the <results> list to ./tmp/<pid> """
    
    mk_tmp(pid)

    basedir = "tmp"
    write_hdf(results, os.path.join(basedir, pid, name+".hdf5"))
Ejemplo n.º 2
0
    def save_results(self, name):
        """ Save results as <name> in the dir specified in the 
        savedir attribute. """

        # ----
        # Create savedir if needed
        try:
            os.mkdir(self.savedir)
        except OSError:
            pass
        
        print("Writing results to disk.")
        savepath = os.path.join(self.savedir, name+".hdf5")
        
        write_hdf(self.results, savepath)