Feature extraction wrappersο
On this page
Default feature extractor for 2 animals and 14 body-partsο
- class simba.feature_extractors.feature_extractor_14bp.ExtractFeaturesFrom14bps(config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.feature_extraction_mixin.FeatureExtractionMixinExtracts hard-coded set of features from pose-estimation data from two animals with 7 tracked body-parts each. Results are stored in the project_folder/csv/features_extracted directory of the SimBA project.
- Parameters
config_path (str) β path to SimBA project config file in Configparser format
- Example
>>> feature_extractor = ExtractFeaturesFrom14bps(config_path='MyProjectConfig') >>> feature_extractor.run()
Default feature extractor for 1 animals and 16 body-partsο
- class simba.feature_extractors.feature_extractor_16bp.ExtractFeaturesFrom16bps(config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.feature_extraction_mixin.FeatureExtractionMixinExtracts hard-coded set of features from pose-estimation data from two animals with 8 tracked body-parts each. Results are stored in the project_folder/csv/features_extracted directory of the SimBA project.
- Parameters
config_path (str) β path to SimBA project config file in Configparser format
- Example
>>> feature_extractor = ExtractFeaturesFrom16bps(config_path='MyProjectConfig') >>> feature_extractor.run()
Default feature extractor for 1 animals and 4 body-partsο
- class simba.feature_extractors.feature_extractor_4bp.ExtractFeaturesFrom4bps(config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.feature_extraction_mixin.FeatureExtractionMixinExtracts hard-coded set of features from pose-estimation data with one animal and 4 tracked body-parts. Results are stored in the
project_folder/csv/features_extracteddirectory of the SimBA project.
- Parameters
config_path (str) β path to SimBA project config file in Configparser format
- Example
>>> feature_extractor = ExtractFeaturesFrom4bps(config_path='MyProjectConfig') >>> feature_extractor.run()
Default feature extractor for 1 animals and 7 body-partsο
- class simba.feature_extractors.feature_extractor_7bp.ExtractFeaturesFrom7bps(config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.feature_extraction_mixin.FeatureExtractionMixinExtracts hard-coded set of features from pose-estimation data from single animals with 7 tracked body-parts. Results are stored in the project_folder/csv/features_extracted directory of the SimBA project.
- Parameters
config_path (str) β path to SimBA project config file in Configparser format
- Example
>>> feature_extractor = ExtractFeaturesFrom7bps(config_path='MyProjectConfig') >>> feature_extractor.run()
Default feature extractor for 1 animals and 8 body-partsο
- class simba.feature_extractors.feature_extractor_8bp.ExtractFeaturesFrom8bps(config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.feature_extraction_mixin.FeatureExtractionMixinExtracts hard-coded set of features from pose-estimation data from single animals with 8 tracked body-parts. Results are stored in the project_folder/csv/features_extracted directory of the SimBA project.
- Parameters
config_path (str) β path to SimBA project config file in Configparser format
- Example
>>> feature_extractor = ExtractFeaturesFrom8bps(config_path='MyProjectConfig') >>> feature_extractor.run()
Default feature extractor for 2 animals and 16 body-partsο
- class simba.feature_extractors.feature_extractor_8bps_2_animals.ExtractFeaturesFrom8bps2Animals(config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.feature_extraction_mixin.FeatureExtractionMixinExtracts hard-coded set of features from pose-estimation data from two animals with 4 tracked body-parts each. Results are stored in the project_folder/csv/features_extracted directory of the SimBA project.
- Parameters
config_path (str) β path to SimBA project config file in Configparser format
- Example
>>> feature_extractor = ExtractFeaturesFrom8bps2Animals(config_path='MyProjectConfig') >>> feature_extractor.run()
Default feature extractor for 1 animals and 9 body-partsο
- class simba.feature_extractors.feature_extractor_9bp.ExtractFeaturesFrom9bps(config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.feature_extraction_mixin.FeatureExtractionMixinExtracts hard-coded set of features from pose-estimation data from single animals with 9 tracked body-parts. Results are stored in the project_folder/csv/features_extracted directory of the SimBA project.
- Parameters
config_path (str) β path to SimBA project config file in Configparser format
- Example
>>> feature_extractor = ExtractFeaturesFrom9bps(config_path='MyProjectConfig') >>> feature_extractor.run()
Default feature extractor for user-defined body-partsο
- class simba.feature_extractors.feature_extractor_user_defined.UserDefinedFeatureExtractor(config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.feature_extraction_mixin.FeatureExtractionMixinGeneric featurizer of data within SimBA project using user-defined body-parts in the pose-estimation data. Results are stored in the project_folder/csv/features_extracted directory of the SimBA project.
- Parameters
config_path (str) β path to SimBA project config file in Configparser format
- Example
>>> feature_extractor = UserDefinedFeatureExtractor(config_path='MyProjectConfig') >>> feature_extractor.run()
Feature extractor for feature subset familyο
- class simba.feature_extractors.feature_subsets.FeatureSubsetsCalculator(config_path, feature_families, file_checks=False, save_dir=None, data_dir=None, append_to_features_extracted=False, append_to_targets_inserted=False)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.train_model_mixin.TrainModelMixinComputes a subset of features from pose for non-ML downstream purposes. E.g., returns the size of animal convex hull in each frame.
- Parameters
config_path (str) β path to SimBA project config file in Configparser format
save_dir (Optional[Union[str, os.PathLike]]) β directory where to store results.
feature_family (List[str]) β List of feature subtype to calculate. E.g., [βTWO-POINT BODY-PART DISTANCES (MM)β].
file_checks (bool) β If true, checks that the files which the data is appended too contains the anticipated number of rows and no duplicate columns after appending. Default False.
save_dir β Directory where to save the data. If None, then the data is only appended.
data_dir (Optional[Union[str, os.PathLike]]) β Directory of pose-estimation data to compute feature subsets for. If None, then the /project_folder/csv/outlier_corrected_movement_locations directory.
append_to_features_extracted (bool) β If True, appends the data to the file sin the features_extracted directory. Default: False.
append_to_targets_inserted (bool) β If True, appends the data to the file sin the targets_inserted directory. Default: False.
Note
Tutorial <https://github.com/sgoldenlab/simba/blob/master/docs/feature_subsets.md>_
- Example
>>> test = FeatureSubsetsCalculator(config_path=r"C:/troubleshooting/mitra/project_folder/project_config.ini", >>> feature_families=[FRAME_BP_MOVEMENT, WITHIN_ANIMAL_THREE_POINT_ANGLES], >>> append_to_features_extracted=False, >>> file_checks=False, >>> append_to_targets_inserted=False, >>> save_dir=r"C:/troubleshooting/mitra/project_folder/csv/new_features") >>> test.run()
Rearing and grooming feature extraction wrapperο
- class simba.feature_extractors.mitra_feature_extractor.MitraFeatureExtractor(config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.abstract_classes.AbstractFeatureExtractionFeature extractor used for grooming and rearing classifications. A subset is of created features are further used for straub-tail classifications.
- Parameters
config_path (Union[str, os.PathLike]) β Path to SimBA project_config.ini.
- Returns
None. Featurized pose-estimation data is saved in the simba project project_folder/csv/features_extracted directory.
- Example
>>> feature_extractor = MitraFeatureExtractor(config_path=r"D: roubleshooting\mitra\project_folder\project_config.ini") >>> feature_extractor.run()
References
- 1
Lazaro et al., Brainwide Genetic Capture for Conscious State Transitions, biorxiv, doi: https://doi.org/10.1101/2025.03.28.646066
Straub tail feature extraction wrapperο
- class simba.feature_extractors.straub_tail_analyzer.StraubTailAnalyzer(config_path, anchor_points, body_parts, save_dir, data_dir=None, video_dir=None)[source]ο
Bases:
simba.mixins.config_reader.ConfigReaderClass using background removed - egocentrically rotated - videos, to featurize tail behavior for downstream straub tail classification.
- Parameters
config_path (Union[str, os.PathLike]) β Path to SimBA project_config.ini.
data_dir (Optional[Union[str, os.PathLike]]) β Path to directory holding pose-estimation data. If None, the uses project_folder/csv/outlier_corrected_movement_location directory in SimBA project.
video_dir (Union[str, os.PathLike]) β Path to directory holding videos. If None, the uses project_folder/videos directory in SimBA project.
save_dir (Union[str, os.PathLike]) β Path to directory where to saved featurized pose-estimation data.
anchor_points (Iterable[str]) β Iterable holding the names od the pose-estimated body-parts belonging to the tail.
body_parts (Iterable[str]) β Iterable holding the names od the pose-estimated body-parts belonging to the animal hull.
References
- 1
Lazaro et al., Brainwide Genetic Capture for Conscious State Transitions, biorxiv, doi: https://doi.org/10.1101/2025.03.28.646066
- Example
>>> runner = StraubTailAnalyzer(config_path=r"C:/troubleshooting/mitra/project_folder/project_config.ini", >>> data_dir=r'C:/troubleshooting/mitra/project_folder/videos/additional/bg_removed/rotated', >>> video_dir=r'C:/troubleshooting/mitra/project_folder/videos/additional/bg_removed/rotated', >>> save_dir=r'C:/troubleshooting/mitra/project_folder/videos/additional/bg_removed/rotated/tail_features_additional', >>> anchor_points=('tail_base', 'tail_center', 'tail_tip'), >>> body_parts=('nose', 'left_ear', 'right_ear', 'right_side', 'left_side', 'tail_base')) >>> runner.run()
Mexican cave fish feature extraction wrapperο
- class simba.feature_extractors.cave_fish_featurizer.CaveFishFeaturizer(config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.feature_extraction_mixin.FeatureExtractionMixinFeature extractor used to score anxiety behaviors in Mexican cave fish species.
Note
This class has previously been named as
fish_feature_extractor_2023_version_5.FishFeatureExtractor
- Parameters
config_path (Union[str, os.PathLike]) β Path to SimBA project_config.ini.
- Returns
None. Featurized pose-estimation data is saved in the simba project project_folder/csv/features_extracted directory.
- Example
>>> _ = CaveFishFeaturizer(config_path='/Users/simon/Desktop/envs/troubleshooting/naresh/project_folder/project_config.ini')
References
- 1
Padmanaban, Naresh, Rianna Ambosie, Stefan Choy, Shoshanah Marcus, Simon R.O. Nilsson, Alex C. Keene, Johanna E. Kowalko, and Erik R. DubouΓ©. βAutomated Behavioral Profiling Using Neural Networks Reveals Differences in Stress-like Behavior between Cave and Surface-Dwelling Astyanax Mexicanus.β Evolutionary Biology, February 5, 2025. https://doi.org/10.1101/2025.01.30.635725.
- static convex_hull_calculator_mp(arr, px_per_mm)[source]ο
Calculate single frame convex hull perimeter length in millimeters.
Note
For acceptable run-time, call using parallel processing.
See also
For numba CPU based acceleration, use
simba.feature_extractors.perimeter_jit.jitted_hull(). For multicore based acceleration, usesimba.mixins.geometry_mixin.GeometryMixin.bodyparts_to_polygon(). For numba CUDA based acceleration, usesimba.data_processors.cuda.geometry.get_convex_hull(),- Parameters
arr (np.ndarray) β 2D array of size len(body-parts) x 2.
px_per_mm (float) β Video pixels per millimeter.
- Returns
The length of the animal perimeter in millimeters.
- Return type
- Example
>>> coordinates = np.random.randint(1, 200, size=(6, 2)).astype(np.float32) >>> FeatureExtractionMixin.convex_hull_calculator_mp(arr=coordinates, px_per_mm=4.56) >>> 98.6676814218373
- static count_values_in_range(data, ranges)[source]ο
Jitted helper finding count of values that falls within ranges. E.g., count number of pose-estimated body-parts that fall within defined bracket of probabilities per frame.
See also
For GPU acceleration, use
simba.data_processors.cuda.statistics.count_values_in_ranges()- Parameters
data (np.ndarray) β 2D numpy array with frames on X.
ranges (np.ndarray) β 2D numpy array representing the brackets. E.g., [[0, 0.1], [0.1, 0.5]]
- Returns
2D numpy array of size data.shape[0], ranges.shape[1]
- Return type
np.ndarray
- Example
>>> FeatureExtractionMixin.count_values_in_range(data=np.random.random((3,10)), ranges=np.array([[0.0, 0.25], [0.25, 0.5]])) >>> [[6, 1], [3, 2],[2, 1]]
- windowed_frequentist_distribution_tests(data, feature_name, fps)[source]ο
Helper to compare feature value distributions in 1s sequential time-bins: Kolmogorov-Smirnov and T-tests Compares the feature values against a normal distribution: Lillefors, Shapiro. Find the number of peaks in rolling 1s long feature window.
Gerbil single body-part feature extraction wrapperο
- class simba.feature_extractors.gerbil_featurizer.GerbilFeaturizer(in_path, out_path)[source]ο
Bases:
objectCompute features from SLEAP pose-estimation data in NPY format with two animals and a single body-part tracked per animal.
- Parameters
- Example
>>> gerbil_featurizer = GerbilFeaturizer(in_path='_gerbil_data/pose_estimation_data', out_path='gerbil_data/featurized_data') >>> gerbil_featurizer.extract_features() >>> gerbil_featurizer.save()
- References
- 1
Mitelut, C, M Diez Castro, Re Peterson, M GonΓ§alves, J Li, Mm Gamer, Sro Nilsson, Td Pereira, and Dh Sanes. βA Behavioral Roadmap for the Development of Agency in the Rodent.β Animal Behavior and Cognition, November 13, 2023. https://doi.org/10.1101/2023.11.10.566632.
- 2
Mitelut, Catalin, Marielisa Diez Castro, Ralph E. Peterson, et al. βContinuous Monitoring and Machine Vision Reveals That Developing Gerbils Exhibit Structured Social Behaviors Prior to the Emergence of Autonomy.β PLOS Biology 23, no. 9 (2025): e3003348. https://doi.org/10.1371/journal.pbio.3003348.
- static calc_animal_distances_in_time_windows(input_array=<class 'numpy.ndarray'>, frm_windows=typing.List[int])[source]ο
Jitted compute of individual frame-by-frame pixel distances and aggregate distance statistics (mean, sum) in rolling time-windows between the two animals.
- Parameters
input_array (np.ndarray) β array of size len(frames) x 4 representing body-part coordinates of two animals [x1, y1, x2, y2].
frm_windows (List[int]) β list of ints representing frame window sizes to calculate aggregate statistics within.
- Returns
np.ndarray single_frm_move: array of size len(frames) x 1 representing frame-by-frame body-part distances in pixels
- Returns
np.ndarray agg_frm_move_mean: array of size len(frames) x len(frm_windows) representing mean frame-by-frame body-part distances in rolling time-windows
- Returns
np.nparray agg_frm_move_sum: array of size len(frames) x len(frm_windows) representing summed frame-by-frame body-part distances in rolling time-windows
- static calc_individual_animal_movements_in_time_windows(input_array=<class 'numpy.ndarray'>, frm_windows=typing.List[int])[source]ο
Jitted compute of individual frame-by-frame pixel movement and aggregate movement statistics (mean, sum) in rolling time-windows for each animal.
- Parameters
input_array (np.ndarray) β array of size len(frames) x 2 representing body-part coordinates
frm_windows β list of ints representing frame window sizes to calculate aggregate statistics within
- Returns
np.ndarray single_frm_move: array of size len(frames) x 1 representing frame-by-frame body-part movements in pixels
- Returns
np.ndarray agg_frm_move_mean: array of size len(frames) x len(frm_windows) representing mean frame-by-frame body-part movements in rolling time-windows
- Returns
np.ndarray agg_frm_move_sum: array of size len(frames) x len(frm_windows) representing summed frame-by-frame body-part movements in rolling time-windows
- static calc_relative_data_in_time_windows(input_array=<class 'numpy.ndarray'>, frm_windows=typing.List[int])[source]ο
Jitted compute of individual frame-by-frame pixel distances and aggregate distance statistics (mean, sum) in rolling time-windows between the two animals. E.g., returns the relative distance between the two animals in the current frame vs 5, 10, 20, 40 frames earlier.
- Parameters
input_array (np.ndarray) β array of size len(frames) x 1 representing a distances or movements of body-parts (one value per framde)
frm_windows (List[int]) β list of ints representing frame window sizes to calculate aggregate statistics within
- Returns
np.ndarray relative_dist_results: array of size len(frames) x len(frm_windows) representing deviation between the current window value from the preceding window value.
Aggression feature extractor (11/25)ο
- class simba.feature_extractors.aggression_feature_extractor.AgressionFeatureExtractor(config_path, data_dir=None, save_dir=None)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.abstract_classes.AbstractFeatureExtractionExtracts behavioral features from pose estimation data for aggression analysis between two animals (resident and intruder).
Note
Custom feature extraction class inhereting from
AbstractFeatureExtractionwhich is not used by default in any of the standard SimBA entry-points.- Parameters
config_path (Union[str, os.PathLike]) β path to SimBA project config file in Configparser format
data_dir (Union[str, os.PathLike]) β Directory containing input CSV files with pose estimation data. If None, uses the projectβs outlier_corrected_dir from the config.
save_dir (Union[str, os.PathLike]) β Directory where featurized CSV files will be saved. If None, uses the projectβs features_dir from the config.
- Example I
>>> extractor = AgressionFeatureExtractor(config_path='MyProjectConfig') >>> extractor.run()
- Example II
>>> f = AgressionFeatureExtractor(config_path=r"E: roubleshooting wo_black_animals_14bp\project_folder\project_config.ini") >>> f.run()
AMBER pipeline feature extractorο
- class simba.feature_extractors.amber_feature_extractor.AmberFeatureExtractor(config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.feature_extraction_mixin.FeatureExtractionMixinClass for extracting features for the AMBER pipeline.
The AMBER pipeline was developed for quantifying home-cage maternal and mother-pup interactions from side-view recordings. Downstream behavior classifiers can be trained to assess maternal nest attendance, nursing, pup-directed licking and grooming, self-directed grooming, eating, and drinking.
Note
For more info, contact Hannah E. Lapp Hannah.Lapp@austin.utexas.edu.
- Example
>>> AmberFeatureExtractor(config_path='/Users/simon/Desktop/envs/simba/troubleshooting/two_black_animals_14bp/project_folder/project_config.ini')
References
- 1
Lapp, Hannah E., Melissa G. Salazar, and Frances A. Champagne. βAutomated Maternal Behavior during Early Life in Rodents (AMBER) Pipeline.β Scientific Reports 13, no. 1 (October 25, 2023): 18277. https://doi.org/10.1038/s41598-023-45495-4.
Boundary rearing feature extractorο
- class simba.feature_extractors.boundary_rearing_analyzer.BoundaryRearingFeaturizer(config_path, data_dir=None, save_dir=None)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.abstract_classes.AbstractFeatureExtraction- Example
>>> x = BoundaryRearingFeaturizer(config_path=r"C: roubleshooting\open_field_rearing\project_folder\project_config.ini") >>> x.run()
Riptortus pedestris feature extractorο
- class simba.feature_extractors.riptortus_featurizer.RiptortusFeaturizer(config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReader,simba.mixins.feature_extraction_mixin.FeatureExtractionMixin,simba.mixins.abstract_classes.AbstractFeatureExtractionFeature extractor used to score feeding behaviors in Riptortus pedestris.
- Parameters
config_path (Union[str, os.PathLike]) β Path to SimBA project_config.ini.
- Returns
None. Featurized pose-estimation data is saved in the simba project project_folder/csv/features_extracted directory.
- Example
>>> _ = RiptortusFeaturizer(config_path='/Users/simon/Desktop/envs/troubleshooting/naresh/project_folder/project_config.ini')
- static convex_hull_calculator_mp(arr, px_per_mm)[source]ο
Calculate single frame convex hull perimeter length in millimeters.
Note
For acceptable run-time, call using parallel processing.
See also
For numba CPU based acceleration, use
simba.feature_extractors.perimeter_jit.jitted_hull(). For multicore based acceleration, usesimba.mixins.geometry_mixin.GeometryMixin.bodyparts_to_polygon(). For numba CUDA based acceleration, usesimba.data_processors.cuda.geometry.get_convex_hull(),- Parameters
arr (np.ndarray) β 2D array of size len(body-parts) x 2.
px_per_mm (float) β Video pixels per millimeter.
- Returns
The length of the animal perimeter in millimeters.
- Return type
- Example
>>> coordinates = np.random.randint(1, 200, size=(6, 2)).astype(np.float32) >>> FeatureExtractionMixin.convex_hull_calculator_mp(arr=coordinates, px_per_mm=4.56) >>> 98.6676814218373
- static count_values_in_range(data, ranges)[source]ο
Jitted helper finding count of values that falls within ranges. E.g., count number of pose-estimated body-parts that fall within defined bracket of probabilities per frame.
See also
For GPU acceleration, use
simba.data_processors.cuda.statistics.count_values_in_ranges()- Parameters
data (np.ndarray) β 2D numpy array with frames on X.
ranges (np.ndarray) β 2D numpy array representing the brackets. E.g., [[0, 0.1], [0.1, 0.5]]
- Returns
2D numpy array of size data.shape[0], ranges.shape[1]
- Return type
np.ndarray
- Example
>>> FeatureExtractionMixin.count_values_in_range(data=np.random.random((3,10)), ranges=np.array([[0.0, 0.25], [0.25, 0.5]])) >>> [[6, 1], [3, 2],[2, 1]]
- windowed_frequentist_distribution_tests(data, feature_name, fps)[source]ο
Helper to compare feature value distributions in 1s sequential time-bins: Kolmogorov-Smirnov and T-tests Compares the feature values against a normal distribution: Lillefors, Shapiro. Find the number of peaks in rolling 1s long feature window.
Custom feature extractorο
- class simba.utils.custom_feature_extractor.CustomFeatureExtractor(extractor_file_path, config_path)[source]ο
Bases:
simba.mixins.config_reader.ConfigReaderClass to execute a feature extraction process based on the user-defined Python script.
This method performs the following steps: 1. Parses the user-defined Python script. 2. Identifies class and function names in the script. 3. Checks for the presence of required imports and specific code patterns. 4. Handle cases of multiple classes and missing configuration arguments. 5. Invokes the feature extraction process if conditions are met.
Note
The user defined feature extraction class needs to contain a
config_pathinit argumentIf the feature extraction class contains multiple classes, then the first class is used.
If the feature extraction class relies on argparse AND inherits
simba.mixins.abstract_classes.AbstractFeatureExtractionthen the feature extraction class will be executed thtough the subprocess module. This ensures that the GUI cannot interfere with the feature extraction process, and reliably execution of multicore processes, if present, in the feature-extraction class.If the feature extraction class does not rely on argparse, then the class will be loaded and executed in python through
sys. It might still be quick and reliable (it often is). However, I have noted that some function, in particular functions that rely onmultiprocessing.imap, are disrupted by the GUI with unacceptable effects on runtime when executed thriughsys.Thus, it is recommended that the custom feature extraction class inherits
simba.mixins.abstract_classes.AbstractFeatureExtractionand is executed through argparse.For an example feature extraction class that inherits from
simba.mixins.abstract_classes.AbstractFeatureExtractionand is executed through argparse, see this file. For an example feature extraction class that does NOT inherit fromsimba.mixins.abstract_classes.AbstractFeatureExtractionand does not use argparse, see this file. More examples can be found in this github documentation. We can give prompt help with troubleshooting through Gitter or GitHb.- Example
>>> test = CustomFeatureExtractor(extractor_file_path='/simba/misc/piotr.py', config_path='/Users/simon/Desktop/envs/troubleshooting/piotr/project_folder/train-20231108-sh9-frames-with-p-lt-2_plus3-&3_best-f1.ini') >>> test.run() >>> test = CustomFeatureExtractor(config_path='/Users/simon/Desktop/envs/troubleshooting/piotr/project_folder/train-20231108-sh9-frames-with-p-lt-2_plus3-&3_best-f1.ini', file_path='/simba/misc/piotr.py') >>> test.run() >>> test = CustomFeatureExtractor(extractor_file_path='/Users/simon/Desktop/envs/simba/simba/simba/feature_extractors/amber_feature_extractor.py', config_path='/Users/simon/Desktop/envs/simba/troubleshooting/Amber_test/project_folder/project_config.ini') >>> test.run()
- has_argparser_argument(file_path, target_argument)[source]ο
Check if a Python script, using argparse, has a specific command-line argument.
- Parameters
file_path (Union[str, os.PathLike]) β Path to the Python script file.
target_argument (str) β The name of the argument to check.
- Return bool
True if the specified argument is found in the scriptβs argparse configuration, False otherwise.
- has_block(file_path, target)[source]ο
Check if a specified block of text exists in a file.
- Parameters
file_path (Union[str, os.PathLike]) β Path to the file to check.
target (str) β The block of text to search for in the file.
- Return bool
True if the specified block of text is found in the file, False otherwise.
