Exemplo n.º 1
0
 def flush(self):
     filename = '%s-%06d'%(self.fileheader, self.index)
     self.index+=1
     self.diskdumps.append(filename)
     self.container.sort()
     with open(filename, 'w') as f:
         spickle.s_dump(self.container, f)
     del(self.container)
     self.container=[]
Exemplo n.º 2
0
def write_results_spickle(results, path):
    """Write a resultset to a streaming pickle file

    Parameters
    ----------
    results : ResultSet
        The set of results
    path : str
        The path of the file to which write
    """
    with open(path, 'wb') as spickle_file:
        spickle.s_dump(results, spickle_file)