From 23e738a0471470f49892e2c7860b8675b32595bd Mon Sep 17 00:00:00 2001 From: Dennis Wittich Date: Thu, 1 Feb 2024 14:03:18 +0100 Subject: [PATCH] fix division by zero error --- learning_loop_node/data_exchanger.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/learning_loop_node/data_exchanger.py b/learning_loop_node/data_exchanger.py index 52768e57..340c13a1 100644 --- a/learning_loop_node/data_exchanger.py +++ b/learning_loop_node/data_exchanger.py @@ -100,6 +100,9 @@ async def _download_images_data(self, organization: str, project: str, image_ids num_image_ids = len(image_ids) self.jepeg_check_info() images_data = [] + if num_image_ids == 0: + logging.info('got empty list. No images were downloaded') + return images_data starttime = time.time() progress_factor = 0.5 / num_image_ids # 50% of progress is for downloading data for i in tqdm(range(0, num_image_ids, chunk_size), position=0, leave=True):