Skip to content

Commit 77fd66f

Browse files
nilodnaVeckoTheGecko
authored andcommitted
add statement to only modify the pbar description with time is a datetime64 or timedelta64
1 parent a92361d commit 77fd66f

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
@@ -545,6 +545,7 @@ def execute(
545545

546546
if verbose_progress:
547547
pbar = tqdm(total=(end_time - start_time) / np.timedelta64(1, "s"), file=sys.stdout)
548+
pbar.set_description("Integration time: " + str(start_time))
548549

549550
next_output = start_time + sign_dt * outputdt if output_file else None
550551

@@ -566,7 +567,9 @@ def execute(
566567
next_output += outputdt
567568

568569
if verbose_progress:
569-
pbar.set_description("Integration time: " + str(time))
570+
if isinstance(time, np.datetime64) or isinstance(time, np.timedelta64):
571+
pbar.set_description("Integration time: " + str(time))
572+
570573
pbar.update((next_time - time) / np.timedelta64(1, "s"))
571574

572575
time = next_time

0 commit comments

Comments
 (0)