Fix channel order bug and make select_channels private#4712
Open
chrishalcrow wants to merge 8 commits into
Open
Fix channel order bug and make select_channels private#4712chrishalcrow wants to merge 8 commits into
select_channels private#4712chrishalcrow wants to merge 8 commits into
Conversation
alejoe91
requested changes
Jul 24, 2026
chrishalcrow
marked this pull request as ready for review
July 24, 2026 12:20
alejoe91
reviewed
Jul 24, 2026
|
|
||
| # Select channels, in a non-monotonic way | ||
| select_channel_ids = np.array(["3", "8", "7"]) | ||
| analyzer_seleted = sorting_analyzer._select_channels(channel_ids=select_channel_ids) |
Member
There was a problem hiding this comment.
Suggested change
| analyzer_seleted = sorting_analyzer._select_channels(channel_ids=select_channel_ids) | |
| analyzer_selected = sorting_analyzer._select_channels(channel_ids=select_channel_ids) |
:)
alejoe91
reviewed
Jul 24, 2026
| wrong_channel_ids = [ch for ch in channel_ids if ch not in self.channel_ids] | ||
| raise ValueError(f"Some channel_ids are not in the current channel_ids: {wrong_channel_ids}") | ||
|
|
||
| select_channel_indices_in_old_recording = [np.where(self.channel_ids == id)[0][0] for id in channel_ids] |
Member
There was a problem hiding this comment.
Suggested change
| select_channel_indices_in_old_recording = [np.where(self.channel_ids == id)[0][0] for id in channel_ids] | |
| select_channel_indices_in_old_recording = self.channel_ids_to_indices(channek_ids) |
Why not this? self is still the old analyzer and it keeps the order, right?
alejoe91
requested changes
Jul 24, 2026
alejoe91
left a comment
Member
There was a problem hiding this comment.
Another couple of minor comments :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a channel order bug in the sparsity mask for the new
select_channelsmethod for analyzers.Discussed with @alejoe91 and decided to keep this method private for now - we hope users will access through the
split_bymethod rather than directly.Fixed waveforms and pca selection.
Todo: add tests for waveforms and pca.