Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
sronilsson committed Jan 17, 2025
2 parents f1e3ab2 + 3757d3f commit 0e483e8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
6 changes: 4 additions & 2 deletions simba/data_processors/cuda/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
import numpy as np
from numba import cuda
from scipy.spatial import ConvexHull
from simba.utils.read_write import read_df, get_unique_values_in_iterable

from simba.utils.read_write import get_unique_values_in_iterable, read_df
from simba.utils.warnings import GPUToolsWarning

try:
import cupy as cp
from cupyx.scipy.spatial.distance import cdist
except:
GPUToolsWarning(msg='GPU tools not detected, reverting to CPU')
from scipy.spatial.distance import cdist
import numpy as cp
from scipy.spatial.distance import cdist

try:
from cuml.cluster import KMeans
Expand Down
8 changes: 5 additions & 3 deletions simba/data_processors/movement_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
import numpy as np
import pandas as pd

from simba.mixins.feature_extraction_supplement_mixin import FeatureExtractionSupplemental
from simba.feature_extractors.perimeter_jit import jitted_centroid
from simba.mixins.config_reader import ConfigReader
from simba.mixins.feature_extraction_mixin import FeatureExtractionMixin
from simba.utils.checks import (check_if_filepath_list_is_empty,check_that_column_exist, check_valid_array, check_float)
from simba.mixins.feature_extraction_supplement_mixin import \
FeatureExtractionSupplemental
from simba.utils.checks import (check_float, check_if_filepath_list_is_empty,
check_that_column_exist, check_valid_array)
from simba.utils.enums import Formats
from simba.utils.printing import stdout_success
from simba.utils.read_write import get_fn_ext, read_df
from simba.utils.enums import Formats


class MovementCalculator(ConfigReader, FeatureExtractionMixin):
Expand Down
10 changes: 6 additions & 4 deletions simba/roi_tools/ROI_analyzer.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
__author__ = "Simon Nilsson"

import os
from typing import List, Optional, Union, Tuple

from typing import List, Optional, Tuple, Union

import numpy as np
import pandas as pd

from simba.mixins.config_reader import ConfigReader
from simba.mixins.feature_extraction_mixin import FeatureExtractionMixin
from simba.mixins.feature_extraction_supplement_mixin import FeatureExtractionSupplemental
from simba.mixins.feature_extraction_supplement_mixin import \
FeatureExtractionSupplemental
from simba.utils.checks import (
check_all_file_names_are_represented_in_video_log,
check_file_exist_and_readable, check_float, check_that_column_exist,
check_valid_lst)
from simba.utils.data import detect_bouts, slice_roi_dict_for_video
from simba.utils.enums import Keys
from simba.utils.errors import (CountError, MissingColumnsError, ROICoordinatesNotFoundError)
from simba.utils.errors import (CountError, MissingColumnsError,
ROICoordinatesNotFoundError)
from simba.utils.printing import stdout_success
from simba.utils.read_write import get_fn_ext, read_data_paths, read_df
from simba.utils.warnings import NoDataFoundWarning


class ROIAnalyzer(ConfigReader, FeatureExtractionMixin):
"""
Analyze movements, entries, exits, and time-spent-in user-defined ROIs. Results are stored in the
Expand Down

0 comments on commit 0e483e8

Please sign in to comment.