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

Commit

Permalink
Added more data to the progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Nov 23, 2022
1 parent d1599f3 commit 92702fc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions python/swiftest/swiftest/simulation_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import subprocess
import shlex
import warnings
from tqdm import tqdm
from tqdm.auto import tqdm
from typing import (
Literal,
Dict,
Expand Down Expand Up @@ -396,8 +396,12 @@ def _type_scrub(output_data):
if process_output:
kvstream=line.replace('\n','').strip().split(';') # Removes the newline character,
output_data = _type_scrub({kv.split()[0]: kv.split()[1] for kv in kvstream[:-1]})
message = f"Time: {output_data['T']} {self.TU_name}/{self.param['TSTOP']} {self.TU_name}"
pbar.set_description_str(message)
pre_message = f"Time: {output_data['T']} / {self.param['TSTOP']} {self.TU_name}"
post_message = f"npl: {output_data['NPL']} ntp: {output_data['NTP']}"
if "NPLM" in output_data:
post_message = post_message + f" nplm: {output_data['NPLM']}"
pbar.set_description_str(pre_message)
pbar.set_postfix_str(post_message)
interval = output_data['ILOOP'] - iloop
if interval > 0:
pbar.update(interval)
Expand Down

0 comments on commit 92702fc

Please sign in to comment.