Skip to content

Commit

Permalink
make get_peak_filter public
Browse files Browse the repository at this point in the history
  • Loading branch information
leoschwarz committed Jul 4, 2024
1 parent 03a70de commit 4d2c5da
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/depiction/tools/filter_peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ class FilterPeaksConfig(BaseModel, use_enum_values=True, validate_default=True):
n_jobs: int | None = None


def _get_filter_object(config: FilterPeaksConfig) -> PeakFilteringType:
def get_peak_filter(config: FilterPeaksConfig) -> PeakFilteringType:
"""Returns the PeakFilteringType instance as specified in config.get_peak_filtering"""
filters = []
for filter in config.filters:
match filter:
Expand All @@ -46,7 +47,7 @@ def _filter_chunk(

def filter_peaks(config: FilterPeaksConfig, input_file: ImzmlReadFile, output_file: ImzmlWriteFile) -> None:
"""Filters the peaks in `input_file` and writes them to `output_file` according to the `config`."""
peaks_filter = _get_filter_object(config)
peaks_filter = get_peak_filter(config)
# TODO n_jobs handling
parallel_config = ParallelConfig(n_jobs=config.n_jobs or 10)
write_parallel = WriteSpectraParallel.from_config(parallel_config)
Expand Down

0 comments on commit 4d2c5da

Please sign in to comment.