diff --git a/src/robofish/evaluate/evaluate.py b/src/robofish/evaluate/evaluate.py index 55935c322bde50e4171e26147e5b899b7252f157..54659cbda35722e51df2ab627bc41d74b0057cfb 100644 --- a/src/robofish/evaluate/evaluate.py +++ b/src/robofish/evaluate/evaluate.py @@ -838,7 +838,6 @@ def evaluate_all( fdict = robofish.evaluate.app.function_dict() fdict.pop("all") - print("Loading all poses and actions.") poses_from_paths, file_settings = utils.get_all_poses_from_paths(paths) speeds_turns_from_paths, file_settings = utils.get_all_data_from_paths( paths, "speeds_turns" diff --git a/src/robofish/io/utils.py b/src/robofish/io/utils.py index 52268948dd45c830d3f98e269c5dd9c805bde027..e1349cdd8dda4bf4b3a08629e0178ddaa41b15a0 100644 --- a/src/robofish/io/utils.py +++ b/src/robofish/io/utils.py @@ -2,7 +2,7 @@ import robofish.io import numpy as np from typing import Union, Iterable from pathlib import Path -import os +from tqdm import tqdm def np_array(*arrays): @@ -78,6 +78,11 @@ def get_all_data_from_paths( files_per_path = get_all_files_from_paths(paths) + pbar = tqdm( + total=sum([len(files_in_path) for files_in_path in files_per_path]), + desc=f"Loading {request_type} from files.", + ) + # for each given path for files_in_path in files_per_path: data_from_files = [] @@ -85,6 +90,8 @@ def get_all_data_from_paths( # Open all files, gather the poses and check if all of them have the same world size and frequency for i_path, file_path in enumerate(files_in_path): with robofish.io.File(file_path, "r") as file: + pbar.update(1) + pbar.refresh() file_settings = { "world_size_cm_x": file.attrs["world_size_cm"][0], "world_size_cm_y": file.attrs["world_size_cm"][1], @@ -111,5 +118,5 @@ def get_all_data_from_paths( data_from_files.append(data) all_data.append(data_from_files) - + pbar.close() return all_data, expected_settings diff --git a/src/robofish/io/validation.py b/src/robofish/io/validation.py index d3013e383623bdfd60553544fff6efd75321bc76..502e0bbb3a06508381770dc28dd571453f1dfa8a 100644 --- a/src/robofish/io/validation.py +++ b/src/robofish/io/validation.py @@ -180,7 +180,7 @@ def validate(iofile: File, strict_validate: bool = True) -> (bool, str): ) if "poses" in entity: raise Exception( - "The poses dataset is depricated. Please use positions and orientations." + "The poses dataset is deprecated. Please use positions and orientations." ) if "positions" in entity: assert_validate(