From ea1d7d1ee8ff67b48a98e29302b5ae90a3dd93f1 Mon Sep 17 00:00:00 2001 From: sronilsson Date: Fri, 20 Dec 2024 18:50:06 +0000 Subject: [PATCH] cleaned --- simba/mixins/train_model_mixin.py | 6 ++++-- simba/sandbox/check_dfs_in_lst.py | 4 +++- simba/utils/checks.py | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/simba/mixins/train_model_mixin.py b/simba/mixins/train_model_mixin.py index 5b9eb77b5..eec56bd1e 100644 --- a/simba/mixins/train_model_mixin.py +++ b/simba/mixins/train_model_mixin.py @@ -58,11 +58,13 @@ from simba.plotting.shap_agg_stats_visualizer import \ ShapAggregateStatisticsVisualizer from simba.ui.tkinter_functions import TwoOptionQuestionPopUp -from simba.utils.checks import (check_file_exist_and_readable, check_float, +from simba.utils.checks import (check_all_dfs_in_list_has_same_cols, + check_file_exist_and_readable, + check_filepaths_in_iterable_exist, check_float, check_if_dir_exists, check_if_valid_input, check_instance, check_int, check_str, check_that_column_exist, check_valid_array, - check_valid_dataframe, check_valid_lst, check_all_dfs_in_list_has_same_cols, check_filepaths_in_iterable_exist) + check_valid_dataframe, check_valid_lst) from simba.utils.data import (detect_bouts, detect_bouts_multiclass, get_library_version) from simba.utils.enums import (OS, ConfigKey, Defaults, Dtypes, Formats, diff --git a/simba/sandbox/check_dfs_in_lst.py b/simba/sandbox/check_dfs_in_lst.py index 87a8e18ec..f08b35203 100644 --- a/simba/sandbox/check_dfs_in_lst.py +++ b/simba/sandbox/check_dfs_in_lst.py @@ -1,8 +1,10 @@ -import pandas as pd from typing import List +import pandas as pd + from simba.utils.checks import check_valid_lst + def check_all_dfs_in_list_has_same_cols(dfs: List[pd.DataFrame], raise_error: bool = True) -> bool: check_valid_lst(data=dfs, source=check_all_dfs_in_list_has_same_cols.__name__, valid_dtypes=(pd.DataFrame,), min_len=1) col_headers = [list(x.columns) for x in dfs] diff --git a/simba/utils/checks.py b/simba/utils/checks.py index 81a20bf7b..b47747432 100644 --- a/simba/utils/checks.py +++ b/simba/utils/checks.py @@ -24,9 +24,10 @@ DirectoryNotEmptyError, FFMPEGNotFoundError, FloatError, FrameRangeError, IntegerError, InvalidFilepathError, InvalidInputError, - NoDataError, NoFilesFoundError, NoROIDataError, + MissingColumnsError, NoDataError, + NoFilesFoundError, NoROIDataError, NotDirectoryError, ParametersFileError, - StringError, MissingColumnsError) + StringError) from simba.utils.warnings import (CorruptedFileWarning, FrameRangeWarning, InvalidValueWarning, NoDataFoundWarning)