4.1.1.1.1.7. lib.data_handling.data_filtering
#
Module that provides functionality in order to filter data.
@author: Thomas Arne Hensel, 2023
4.1.1.1.1.7.1. Module Contents#
4.1.1.1.1.7.1.1. Classes#
Class for filtering data based on certain criteria. |
|
Class for filtering Minflux data based on certain criteria. |
4.1.1.1.1.7.1.2. Functions#
Filter a single file based on certain criteria. |
|
Check whether experiments comply with filter criteria. |
4.1.1.1.1.7.1.3. API#
- class lib.data_handling.data_filtering.Filter(collect_artefacts=True)#
Class for filtering data based on certain criteria.
Attributes: - ext (Extractor): Extractor instance for data extraction. - artefacts (Artefacts): Artefacts instance for storing figures and other artifacts. - collect_artefacts (bool): Flag indicating whether to collect and store artifacts.
Methods: - filter_data(in_folder, base_out, max_files=100, batchsize=1, agnostic=True, fast_return=False):
Iterate through a nested directory and filter data based on certain criteria.
Initialization
Constructor for the Filter class.
- Parameters:
collect_artefacts (bool, optional, default is True.) – Flag indicating whether to collect and store artifacts.
- filter_data(in_folder, base_out, max_files=100, batchsize=1, agnostic=True, fast_return=False)#
Iterate through a nested directory and filter data based on certain criteria.
- Parameters:
in_folder (str) – Root of the input directory.
base_out (str) – Root of the output directory.
max_files (int, optional, default is 100.) – Maximum number of files to be analyzed in one directory.
batchsize (int, optional, default is 1.) – Size of moving average.
agnostic (bool, optional, default is True.) – Specify whether construction is agnostic or not.
fast_return (bool, optional, default is False.) – Optional direct return of experiment object.
- lib.data_handling.data_filtering.filter_single_file(full_file_path, base_out, batchsize=1, agnostic=True, fast_return=False, collect_artefacts=True)#
Filter a single file based on certain criteria.
- Parameters:
full_file_path (str) – Full path to the input file.
base_out (str) – Root of the output directory.
batchsize (int, optional, default is 1.) – Size of moving average.
agnostic (bool, optional, default is True.) – Specify whether construction is agnostic or not.
fast_return (bool, optional, default is False.) – Optional direct return of experiment object.
collect_artefacts (bool, optional, default is True.) – Flag indicating whether to collect and store artifacts.
- Returns:
Reason for rejection or None if the file is accepted.
- Return type:
str
- lib.data_handling.data_filtering.filter_experiments(experiments)#
Check whether experiments comply with filter criteria.
- Parameters:
experiments (list) – List of Experiment objects.
- Returns:
Reason for rejection or None if the experiments are accepted.
- Return type:
str
- class lib.data_handling.data_filtering.MinfluxFilter(collect_artefacts=True)#
Class for filtering Minflux data based on certain criteria.
Attributes: - ext (Extractor): Extractor instance for data extraction. - artefacts (Artefacts): Artefacts instance for storing figures and other artifacts. - collect_artefacts (bool): Flag indicating whether to collect and store artifacts.
Methods: - __init__(collect_artefacts=True): Constructor for the MinfluxFilter class.
Initialization
Constructor for the MinfluxFilter class.
- Parameters:
collect_artefacts (bool, optional, default is True.) – Flag indicating whether to collect and store artifacts.