diff --git a/simba/mixins/plotting_mixin.py b/simba/mixins/plotting_mixin.py index 7291e3ad7..54b7c3a95 100644 --- a/simba/mixins/plotting_mixin.py +++ b/simba/mixins/plotting_mixin.py @@ -15,7 +15,6 @@ import seaborn as sns from matplotlib import cm from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas - from numba import bool_, njit, uint8 from PIL import Image diff --git a/simba/plotting/ROI_feature_visualizer_mp.py b/simba/plotting/ROI_feature_visualizer_mp.py index 560c77831..010911a7f 100644 --- a/simba/plotting/ROI_feature_visualizer_mp.py +++ b/simba/plotting/ROI_feature_visualizer_mp.py @@ -5,7 +5,7 @@ import multiprocessing import os import platform -from typing import Any, Dict, List, Optional, Union, Tuple +from typing import Any, Dict, List, Optional, Tuple, Union import cv2 import numpy as np diff --git a/simba/plotting/gantt_creator.py b/simba/plotting/gantt_creator.py index 3ba721bbd..46521d9ae 100644 --- a/simba/plotting/gantt_creator.py +++ b/simba/plotting/gantt_creator.py @@ -3,7 +3,7 @@ import io import os import shutil -from typing import Dict, List, Union, Optional +from typing import Dict, List, Optional, Union import cv2 import matplotlib.pyplot as plt @@ -12,10 +12,10 @@ from simba.mixins.config_reader import ConfigReader from simba.mixins.plotting_mixin import PlottingMixin -from simba.utils.checks import (check_all_file_names_are_represented_in_video_log, - check_file_exist_and_readable, - check_valid_lst, - check_if_keys_exist_in_dict) +from simba.utils.checks import ( + check_all_file_names_are_represented_in_video_log, + check_file_exist_and_readable, check_if_keys_exist_in_dict, + check_valid_lst) from simba.utils.data import detect_bouts from simba.utils.enums import Formats from simba.utils.errors import NoSpecifiedOutputError diff --git a/simba/plotting/gantt_creator_mp.py b/simba/plotting/gantt_creator_mp.py index ad18f89cd..82a3859f4 100644 --- a/simba/plotting/gantt_creator_mp.py +++ b/simba/plotting/gantt_creator_mp.py @@ -5,31 +5,36 @@ warnings.simplefilter(action="ignore", category=FutureWarning) import functools +import io import multiprocessing import os -import io -import PIL import platform import shutil -import cv2 -import pandas as pd from typing import Dict, List, Optional, Union -import numpy as np -import matplotlib.pyplot as plt + +import cv2 import matplotlib -from matplotlib.figure import Figure +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import PIL #matplotlib.use('agg') from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas +from matplotlib.figure import Figure from simba.mixins.config_reader import ConfigReader from simba.mixins.plotting_mixin import PlottingMixin -from simba.utils.checks import (check_all_file_names_are_represented_in_video_log, check_file_exist_and_readable, check_if_keys_exist_in_dict, check_int, check_that_column_exist, check_valid_lst) +from simba.utils.checks import ( + check_all_file_names_are_represented_in_video_log, + check_file_exist_and_readable, check_if_keys_exist_in_dict, check_int, + check_that_column_exist, check_valid_lst) from simba.utils.data import detect_bouts from simba.utils.enums import Formats from simba.utils.errors import NoSpecifiedOutputError from simba.utils.lookups import get_named_colors from simba.utils.printing import SimbaTimer, stdout_success -from simba.utils.read_write import (concatenate_videos_in_folder, find_core_cnt, get_fn_ext, read_df) +from simba.utils.read_write import (concatenate_videos_in_folder, + find_core_cnt, get_fn_ext, read_df) HEIGHT = "height" WIDTH = "width" diff --git a/simba/plotting/heat_mapper_location.py b/simba/plotting/heat_mapper_location.py index 01218b4ed..6a13db65a 100644 --- a/simba/plotting/heat_mapper_location.py +++ b/simba/plotting/heat_mapper_location.py @@ -1,22 +1,25 @@ __author__ = "Simon Nilsson" import os -from typing import List, Union, Optional, Any, Dict +import shutil +from typing import Any, Dict, List, Optional, Union import cv2 import numpy as np import pandas as pd from numba import jit, prange -import shutil from simba.mixins.config_reader import ConfigReader from simba.mixins.geometry_mixin import GeometryMixin from simba.mixins.plotting_mixin import PlottingMixin +from simba.utils.checks import ( + check_all_file_names_are_represented_in_video_log, + check_file_exist_and_readable, check_float, check_if_keys_exist_in_dict, + check_int, check_valid_lst) from simba.utils.enums import Formats, TagNames from simba.utils.errors import NoSpecifiedOutputError from simba.utils.printing import SimbaTimer, log_event, stdout_success from simba.utils.read_write import get_fn_ext, read_df -from simba.utils.checks import check_file_exist_and_readable, check_valid_lst, check_if_keys_exist_in_dict, check_int, check_all_file_names_are_represented_in_video_log, check_float STYLE_PALETTE = 'palette' STYLE_SHADING = 'shading' diff --git a/simba/plotting/heat_mapper_location_mp.py b/simba/plotting/heat_mapper_location_mp.py index 84088251e..78c389acd 100644 --- a/simba/plotting/heat_mapper_location_mp.py +++ b/simba/plotting/heat_mapper_location_mp.py @@ -2,7 +2,7 @@ import multiprocessing import os import platform -from typing import List, Optional, Union, Any, Dict +from typing import Any, Dict, List, Optional, Union import cv2 import numpy as np @@ -11,12 +11,16 @@ from simba.mixins.config_reader import ConfigReader from simba.mixins.geometry_mixin import GeometryMixin from simba.mixins.plotting_mixin import PlottingMixin +from simba.utils.checks import ( + check_all_file_names_are_represented_in_video_log, + check_file_exist_and_readable, check_float, check_if_keys_exist_in_dict, + check_int, check_valid_lst) from simba.utils.enums import Defaults, Formats, TagNames from simba.utils.errors import NoSpecifiedOutputError from simba.utils.printing import SimbaTimer, log_event, stdout_success -from simba.utils.read_write import (concatenate_videos_in_folder, find_core_cnt, get_fn_ext, read_df, remove_a_folder) -from simba.utils.checks import check_file_exist_and_readable, check_valid_lst, check_if_keys_exist_in_dict, check_int, check_all_file_names_are_represented_in_video_log, check_float - +from simba.utils.read_write import (concatenate_videos_in_folder, + find_core_cnt, get_fn_ext, read_df, + remove_a_folder) STYLE_PALETTE = 'palette' STYLE_SHADING = 'shading' diff --git a/simba/plotting/plot_clf_results.py b/simba/plotting/plot_clf_results.py index 3292074c1..c7f51fe4c 100644 --- a/simba/plotting/plot_clf_results.py +++ b/simba/plotting/plot_clf_results.py @@ -13,12 +13,14 @@ from simba.mixins.config_reader import ConfigReader from simba.mixins.plotting_mixin import PlottingMixin from simba.mixins.train_model_mixin import TrainModelMixin -from simba.utils.checks import (check_file_exist_and_readable, check_float, check_int) +from simba.utils.checks import (check_file_exist_and_readable, check_float, + check_int) from simba.utils.data import create_color_palette from simba.utils.enums import ConfigKey, Dtypes, Formats, TagNames from simba.utils.errors import NoSpecifiedOutputError from simba.utils.printing import log_event, stdout_success -from simba.utils.read_write import (get_fn_ext, get_video_meta_data, read_config_entry, read_df) +from simba.utils.read_write import (get_fn_ext, get_video_meta_data, + read_config_entry, read_df) class PlotSklearnResultsSingleCore(ConfigReader, TrainModelMixin, PlottingMixin):