From 5c1afcec08c61ae978d9312a3ce23cec1a6da100 Mon Sep 17 00:00:00 2001 From: Anno Knierim Date: Mon, 20 Jan 2025 11:30:14 +0100 Subject: [PATCH] Switch to tqdm.autonotebook, refactor tqdm call --- pyvisgen/simulation/visibility.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pyvisgen/simulation/visibility.py b/pyvisgen/simulation/visibility.py index a77e8fa..4bacda1 100644 --- a/pyvisgen/simulation/visibility.py +++ b/pyvisgen/simulation/visibility.py @@ -2,7 +2,7 @@ import torch import toma -from tqdm import tqdm +from tqdm.autonotebook import tqdm import pyvisgen.simulation.scan as scan @@ -176,9 +176,13 @@ def _batch_loop( Visibilities dataclass object. """ batches = torch.arange(bas[:].shape[1]).split(batch_size) - - if show_progress: - batches = tqdm(batches) + batches = tqdm( + batches, + position=0, + disable=not show_progress, + desc="Computing visibilities", + postfix=f"Batchsize: {batch_size}", + ) for p in batches: bas_p = bas[:][:, p]