Skip to content

Commit

Permalink
Merge pull request #618 from ftsamis/to_hdf-last_iteration
Browse files Browse the repository at this point in the history
to_hdf: If only the last run is stored, do not add a counter in the name
  • Loading branch information
wkerzendorf authored Jun 30, 2016
2 parents ec512c8 + 6c43755 commit e7a7f62
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tardis/simulation/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,9 +340,11 @@ def legacy_run_simulation(self, model, hdf_path_or_buf=None,
self.iterations_executed, time.time()-start_time))

if hdf_path_or_buf is not None:
self.to_hdf(model, hdf_path_or_buf,
'simulation{}'.format(self.iterations_executed),
plasma_properties)
if hdf_last_only:
name = 'simulation'
else:
name = 'simulation{}'.format(self.iterations_executed)
self.to_hdf(model, hdf_path_or_buf, name, plasma_properties)

def legacy_set_final_model_properties(self, model):
"""Sets additional model properties to be compatible with old model design
Expand Down

0 comments on commit e7a7f62

Please sign in to comment.