From d84f7578631fff7f10f170aca85960b8fd3cd62a Mon Sep 17 00:00:00 2001 From: mschwoerer <82171591+mschwoer@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:58:51 +0200 Subject: [PATCH] #296: set tqdm log minimum to 5 seconds --- alphadia/fdrexperimental.py | 4 ++-- alphadia/outputaccumulator.py | 3 ++- alphadia/transferlearning/train.py | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/alphadia/fdrexperimental.py b/alphadia/fdrexperimental.py index c8d4cc20..901258eb 100644 --- a/alphadia/fdrexperimental.py +++ b/alphadia/fdrexperimental.py @@ -368,7 +368,7 @@ def fit(self, x: np.ndarray, y: np.ndarray): y_test = torch.from_numpy(y_test).float().to(self.device) batch_count = 0 - for epoch in tqdm(range(self.epochs)): + for epoch in tqdm(range(self.epochs), mininterval=5): train_loss_sum = 0.0 test_loss_sum = 0.0 @@ -1122,7 +1122,7 @@ def fit(self, x: np.ndarray, y: np.ndarray): batch_count = 0 - for epoch in tqdm(range(self.epochs)): + for epoch in tqdm(range(self.epochs), mininterval=5): # shuffle batches order = np.random.permutation(num_batches) batch_start_list = batch_start_list[order] diff --git a/alphadia/outputaccumulator.py b/alphadia/outputaccumulator.py index 4d0ef135..63010c63 100644 --- a/alphadia/outputaccumulator.py +++ b/alphadia/outputaccumulator.py @@ -553,7 +553,8 @@ def ms2_quality_control( precursor_df["frag_stop_idx"], strict=True, ) - ) + ), + mininterval=5, ): # get XIC correlations and intensities for the precursor fragment_correlation_view = fragment_correlation_df.iloc[start_idx:stop_idx] diff --git a/alphadia/transferlearning/train.py b/alphadia/transferlearning/train.py index 69eaeed7..343be3a2 100644 --- a/alphadia/transferlearning/train.py +++ b/alphadia/transferlearning/train.py @@ -287,7 +287,7 @@ def _order_intensities( The reordered fragment intensity dataframe. """ reordered = unordered_frag_df.copy() - for i in tqdm(range(len(reordered_precursor_df))): + for i in tqdm(range(len(reordered_precursor_df)), mininterval=5): new_start_idx = reordered_precursor_df.iloc[i]["frag_start_idx"] new_end_idx = reordered_precursor_df.iloc[i]["frag_stop_idx"]