Public Access
implemented incremental HDF5 writing (Fixes #33)
This commit is contained in:
@@ -874,15 +874,6 @@ class DamarisGUI:
|
||||
filters=tables.Filters( complevel=9, complib='zlib' ) )
|
||||
|
||||
if dump_file is None and os.path.isfile( self.dump_filename ) and tables.is_pytables_file( self.dump_filename ):
|
||||
# take some data from dump file and repack
|
||||
os.rename( self.dump_filename, self.dump_filename + ".bak" )
|
||||
old_dump_file = tables.open_file( self.dump_filename + ".bak", mode="r+" )
|
||||
if "data_pool" in old_dump_file.root:
|
||||
old_dump_file.remove_node( where="/", name="data_pool", recursive=True )
|
||||
old_dump_file.copy_file( self.dump_filename )
|
||||
old_dump_file.close( )
|
||||
del old_dump_file
|
||||
os.remove( self.dump_filename + ".bak" )
|
||||
# prepare for update
|
||||
dump_file = tables.open_file( self.dump_filename, mode="r+" )
|
||||
|
||||
@@ -899,7 +890,8 @@ class DamarisGUI:
|
||||
|
||||
# save the data!
|
||||
self.data.write_hdf5( dump_file, where="/", name="data_pool",
|
||||
complib=self.dump_complib, complevel=self.dump_complevel )
|
||||
complib=self.dump_complib, complevel=self.dump_complevel,
|
||||
incremental=not init )
|
||||
|
||||
# now save additional information
|
||||
e = self.si.data.get( "__recentexperiment", -1 ) + 1
|
||||
|
||||
Reference in New Issue
Block a user