Skip to content

Commit 7806563

Browse files
committed
add statement to only modify the pbar description with time is a datetime64 or timedelta64
1 parent f121dfa commit 7806563

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

parcels/_core/particleset.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ def execute(
549549

550550
if verbose_progress:
551551
pbar = tqdm(total=(end_time - start_time) / np.timedelta64(1, "s"), file=sys.stdout)
552+
pbar.set_description("Integration time: " + str(start_time))
552553

553554
next_output = start_time + sign_dt * outputdt if output_file else None
554555

@@ -570,7 +571,9 @@ def execute(
570571
next_output += outputdt
571572

572573
if verbose_progress:
573-
pbar.set_description("Integration time: " + str(time))
574+
if isinstance(time, np.datetime64) or isinstance(time, np.timedelta64):
575+
pbar.set_description("Integration time: " + str(time))
576+
574577
pbar.update((next_time - time) / np.timedelta64(1, "s"))
575578

576579
time = next_time

0 commit comments

Comments
 (0)