We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f9a4ad commit 13864e1Copy full SHA for 13864e1
abie/data_io.py
@@ -73,12 +73,15 @@ def flush(self):
73
Write the simulation data buffer to the HDF5 file unconditionally.
74
:return:
75
"""
76
+ if self.buf_cursor == 0:
77
+ # already flushed
78
+ return
79
80
if self.h5_file is None:
81
self.h5_file = h5py.File(self.output_file_name, 'w')
82
self.h5_file.attrs['G'] = self.CONST_G
83
h5_step_group = self.h5_file.create_group('Step#%d' % self.h5_step_id)
-
84
+
85
state_dict = {
86
'time': self.buf_t[:self.buf_cursor],
87
'mass': self.buf_mass[:self.buf_cursor],
0 commit comments