Skip to content

Commit

Permalink
kbs pbar (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoranAngevaare committed May 27, 2021
1 parent c3ce079 commit 423225e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion strax/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,12 @@ def _update_progress_bar(pbar, t_start, t_end, n_chunks, chunk_end, nbytes):
# Let's add the postfix which is the info behind the tqdm marker
seconds_per_chunk = time.time() - pbar.last_print_t
pbar.mbs.append((nbytes/1e6)/seconds_per_chunk)
postfix = f'#{n_chunks} ({seconds_per_chunk:.2f} s). {np.mean(pbar.mbs):.1f} MB/s'
mbs = np.mean(pbar.mbs)
if mbs < 1:
rate = f'{mbs*1000:.1f} kB/s'
else:
rate = f'{mbs:.1f} MB/s'
postfix = f'#{n_chunks} ({seconds_per_chunk:.2f} s). {rate}'
pbar.set_postfix_str(postfix)
pbar.update(0)

Expand Down

0 comments on commit 423225e

Please sign in to comment.