Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/spikeinterface/core/analyzer_extension_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@ class BaseMetric:
needs_tmp_data = False # whether the metric needs temporary data computed with MetricExtension._prepare_data
needs_job_kwargs = False # whether the metric needs job_kwargs
supports_periods = False # whether the metric function supports periods
supports_spike_batches = False # whether the metric function accepts max_spikes_per_batch
depend_on = [] # extensions the metric depends on
deprecated_names = [] # list of metric names used by previous versions of spikeinterface

Expand Down Expand Up @@ -1308,6 +1309,8 @@ def _compute_metrics(
t_start = time.perf_counter()
try:
metric_params = self.params["metric_params"].get(metric_name, {})
if metric.supports_spike_batches and "max_spikes_per_batch" in self.params:
metric_params = dict(metric_params, max_spikes_per_batch=self.params["max_spikes_per_batch"])

res = metric.compute(
sorting_analyzer,
Expand Down
Loading
Loading