Skip to content

Commit

Permalink
cleaned
Browse files Browse the repository at this point in the history
  • Loading branch information
sronilsson committed Dec 19, 2024
1 parent dbb6e85 commit 9586c81
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 21 deletions.
4 changes: 2 additions & 2 deletions simba/mixins/train_model_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
from simba.utils.checks import (check_file_exist_and_readable, check_float,
check_if_dir_exists, check_if_valid_input,
check_instance, check_int, check_str,
check_that_column_exist, check_valid_dataframe,
check_valid_lst, check_valid_array)
check_that_column_exist, check_valid_array,
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,
Expand Down
21 changes: 13 additions & 8 deletions simba/mixins/unsupervised_mixin.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
__author__ = "Simon Nilsson"
import datetime
from typing import Union
import pandas as pd

import numpy as np
import datetime
import pandas as pd

from simba.data_processors.cuda.utils import _cuda_available
from simba.utils.checks import check_float, check_int, check_valid_boolean, check_instance, check_valid_array
from simba.utils.errors import SimBAGPUError
from simba.utils.checks import (check_float, check_instance, check_int,
check_valid_array, check_valid_boolean)
from simba.utils.data import get_library_version
from simba.utils.lookups import get_model_names
from simba.utils.enums import Formats
from simba.utils.errors import SimBAGPUError
from simba.utils.lookups import get_model_names

try:
import cuml.umap as cuml_umap
import cuml.cluster.hdbscan as cuml_hdbscan
import cuml.umap as cuml_umap
except ModuleNotFoundError:
import umap as cuml_umap
import hdbscan as cuml_hdbscan
import umap as cuml_umap
pass
import umap
import hdbscan
import umap


class UMLMixin(object):
def __init__(self):
Expand Down
10 changes: 8 additions & 2 deletions simba/plotting/heat_mapper_clf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@

import os
from typing import List, Union

import cv2
import numpy as np

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_filepaths_in_iterable_exist, check_int, check_str,
check_valid_dataframe, check_valid_dict)
from simba.utils.enums import Formats, Options
from simba.utils.errors import NoSpecifiedOutputError, InvalidInputError
from simba.utils.errors import InvalidInputError, NoSpecifiedOutputError
from simba.utils.printing import SimbaTimer, stdout_success
from simba.utils.read_write import get_fn_ext, read_df
from simba.utils.checks import check_all_file_names_are_represented_in_video_log, check_str, check_valid_dict, check_filepaths_in_iterable_exist, check_valid_dataframe, check_int


class HeatMapperClfSingleCore(ConfigReader, PlottingMixin):
"""
Expand Down
15 changes: 10 additions & 5 deletions simba/plotting/heat_mapper_clf_mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import multiprocessing
import os
import platform
from typing import Union, List
from typing import List, Union

import cv2
import numpy as np
Expand All @@ -13,13 +13,18 @@

import simba.mixins.plotting_mixin
from simba.mixins.config_reader import ConfigReader
from simba.mixins.plotting_mixin import PlottingMixin
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_filepaths_in_iterable_exist, check_int, check_str,
check_valid_boolean, check_valid_dataframe, check_valid_dict)
from simba.utils.enums import Formats
from simba.utils.errors import NoSpecifiedOutputError, InvalidInputError
from simba.utils.errors import InvalidInputError, NoSpecifiedOutputError
from simba.utils.printing import SimbaTimer, stdout_success
from simba.utils.read_write import (concatenate_videos_in_folder, get_fn_ext, read_df, remove_a_folder, find_core_cnt)
from simba.utils.checks import check_valid_boolean, check_int, check_str, check_valid_dict, check_filepaths_in_iterable_exist, check_all_file_names_are_represented_in_video_log, check_valid_dataframe
from simba.utils.read_write import (concatenate_videos_in_folder,
find_core_cnt, get_fn_ext, read_df,
remove_a_folder)


def _heatmap_multiprocessor(data: np.array,
Expand Down
8 changes: 5 additions & 3 deletions simba/plotting/heat_mapper_location_mp.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
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, check_filepaths_in_iterable_exist)
check_file_exist_and_readable, check_filepaths_in_iterable_exist,
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.read_write import (concatenate_videos_in_folder,
find_core_cnt, get_fn_ext, read_df,
remove_a_folder)

STYLE_PALETTE = 'palette'
STYLE_SHADING = 'shading'
Expand Down
2 changes: 1 addition & 1 deletion simba/utils/lookups.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import simba
from simba.utils.checks import (check_file_exist_and_readable,
check_if_dir_exists)
from simba.utils.enums import OS, FontPaths, Methods, Paths, UML
from simba.utils.enums import OS, UML, FontPaths, Methods, Paths
from simba.utils.read_write import get_fn_ext
from simba.utils.warnings import NoDataFoundWarning

Expand Down

0 comments on commit 9586c81

Please sign in to comment.