fix(simulator): set the correct total for progress bar

This commit is contained in:
Anthony Berg 2025-07-03 14:18:44 +02:00
parent 638e2a4ea8
commit cc9937c752

View File

@ -106,7 +106,7 @@ class BaseSimulator(object):
if tolerance is None:
tolerance = 0.000000001
with tqdm(total=t_end, desc="Running Simulator") as pbar:
with tqdm(total=t, desc="Running Simulator", leave=False) as pbar:
while self.sim_time() < t_end:
# Prevent an infinite loop from occurring from tiny numbers
if abs(t_end - self.sim_time()) < tolerance:
@ -123,12 +123,9 @@ class BaseSimulator(object):
self.logger.warning(f"Timestep size {self.sim_steps()} is less than or equal to zero!")
break
prev_time = self.sim_time()
# Step forward in time
self.step(current_dt)
# Update the progress bar
pbar.update(float(current_dt))