Skip to content

Commit a95dc57

Browse files
authored
Merge pull request #3815 from zm711/fix3814
Fix error message and pass through function for generating `NumpySorting`
2 parents 28a8764 + 83ec7c9 commit a95dc57

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/spikeinterface/core/numpyextractors.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,20 @@ def from_times_and_labels(times_list, labels_list, sampling_frequency, unit_ids=
367367

368368
@staticmethod
369369
def from_times_labels(times_list, labels_list, sampling_frequency, unit_ids=None) -> "NumpySorting":
370+
warning_msg = (
371+
"`from_times_labels` is deprecated and will be removed in 0.104.0. Note this function requires"
372+
"samples rather than times so should not be used for clarity purposes. For those working in samples please"
373+
"use `from_samples_and_labels` instead. For those working in time units (seconds) please use "
374+
"`from_times_and_labels` instead."
375+
)
376+
370377
warnings.warn(
371-
"from_times_labels is deprecated and will be removed in 0.104.0, use from_sample_and_labels instead",
378+
warning_msg,
372379
DeprecationWarning,
373380
stacklevel=2,
374381
)
375-
return NumpySorting.from_times_and_labels(times_list, labels_list, sampling_frequency, unit_ids)
382+
# despite the naming of the original function this required samples
383+
return NumpySorting.from_samples_and_labels(times_list, labels_list, sampling_frequency, unit_ids)
376384

377385
@staticmethod
378386
def from_unit_dict(units_dict_list, sampling_frequency) -> "NumpySorting":

0 commit comments

Comments
 (0)