Skip to content

Commit

Permalink
add benchmarks for reading with dask
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmig committed Oct 11, 2023
1 parent de07933 commit 3954420
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions benchmarks/cellfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from pathlib import Path

import pooch
from cellfinder_core.tools.IO import read_with_dask

from brainglobe_workflows.cellfinder.cellfinder_main import (
CellfinderConfig,
Expand All @@ -16,7 +17,7 @@
class TimeBenchmarkPrepGIN:
"""
A base class with sensible options for timing the cellfinder workflow.
A base class for timing benchmarks for the cellfinder workflow.
It includes:
- a setup_cache function that downloads the GIN data specified in the
Expand Down Expand Up @@ -149,16 +150,27 @@ def teardown(self):


class TimeFullWorkflow(TimeBenchmarkPrepGIN):
"""Time the full cellfinder workflow.
It includes reading the signal and background arrays with dask,
detecting the cells and saving the results to an XML file
Parameters
----------
TimeBenchmarkPrepGIN : _type_
A base class for timing benchmarks for the cellfinder workflow.
"""

def time_workflow_from_cellfinder_run(self):
run_workflow_from_cellfinder_run(self.cfg)


# class TimeReadInputDask(TimeBenchmark):
# def time_read_signal_w_dask(self):
# read_with_dask(self.cfg.signal_parent_dir)
class TimeReadInputDask(TimeBenchmarkPrepGIN):
def time_read_signal_w_dask(self):
read_with_dask(self.cfg.signal_dir_path)

# def time_read_background_w_dask(self):
# read_with_dask(self.cfg.background_parent_dir)
def time_read_background_w_dask(self):
read_with_dask(self.cfg.background_dir_path)


# class TimeCellfinderRun(TimeBenchmark):
Expand Down

0 comments on commit 3954420

Please sign in to comment.