Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming: from_time_labels -> from_samples_labels #3724

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alejoe91
Copy link
Member

and adding from_times_labels

fixes #3723

@alejoe91 alejoe91 added core Changes to core module refactor Refactor of code, with no change to functionality labels Feb 27, 2025
Copy link
Collaborator

@yger yger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, and I agree it would be easier to understand

zm711
zm711 previously approved these changes Mar 2, 2025
Copy link
Collaborator

@zm711 zm711 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is clutch for understandability. I think the other longer term thing we should think about (pre-1.0 in my opinion) is moving from the frame -> sample terminology in all places.

@@ -711,7 +711,7 @@ In this example, we create a recording and a sorting object from numpy objects:
spike_trains += spike_trains_i
labels += labels_i

sorting_memory = NumpySorting.from_times_labels(times=spike_trains, labels=labels,
sorting_memory = NumpySorting.from_samples_labels(times=spike_trains, labels=labels,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How comes the argument is still called times here, is this something we should change?

@h-mayorquin
Copy link
Collaborator

h-mayorquin commented Mar 3, 2025

Two request:

  1. Can we add a deprecation so we don't break code.
  2. Can the method be from_samples_and_labels and from_times_and_labels

I find the lack of and very confusing in how I read the naming. As in, if the labels were the labels of the times.

As I am writing this I am thinking, aren't the labels the unit_ids? Shouldn't we use that terminology? from_samples_and_units_ids or something like that? I feel less strong about this last point but I feel strongly about the and.

@zm711
Copy link
Collaborator

zm711 commented Mar 3, 2025

I think those are great points Heberto! I was thinking something similar to point 2, but didn't want the double break. But I think you're right that if this breaking change is being done might as well as make it as clear as possible moving forward. I like the from_samples_and_labels but I take your point that in spikeinterface terminology we use unit_ids as our neuron "labels".

@samuelgarcia
Copy link
Member

I like the idea but we need to be backward compatible here (with a warning)
So maybe the idea of @h-mayorquin is the good way and so we keep the old one.

@zm711 zm711 dismissed their stale review March 5, 2025 23:53

stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Changes to core module refactor Refactor of code, with no change to functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mis-informing naming in se.NumpySorting
5 participants