Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Corrected the computation of the width of the time report output vari…
Browse files Browse the repository at this point in the history
…able so that it has only the number of significant digits needed
  • Loading branch information
daminton committed Dec 1, 2022
1 parent 7bda5ca commit a003255
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def _type_scrub(output_data):
process_output = False
noutput = int((self.param['TSTOP'] - self.param['T0']) / self.param['DT'])
iloop = int((self.param['TSTART'] - self.param['T0']) / self.param['DT'])
twidth = int(np.ceil(np.log10(self.param['TSTOP']/self.param['DT'])))
twidth = int(np.ceil(np.log10(self.param['TSTOP']/(self.param['DT'] * self.param['ISTEP_OUT']))))
pre_message = f"Time: {self.param['TSTART']:.{twidth}e} / {self.param['TSTOP']:.{twidth}e} {self.TU_name} "
post_message = f"npl: {self.data['npl'].values[0]} ntp: {self.data['ntp'].values[0]}"
if "nplm" in self.data:
Expand Down

0 comments on commit a003255

Please sign in to comment.