-
Notifications
You must be signed in to change notification settings - Fork 241
using spike_vector on core/check_sortings_equal test
#4282
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
Open
tayheau
wants to merge
13
commits into
SpikeInterface:main
Choose a base branch
from
tayheau:spike_vector_test_check_sorting_equal
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
b210494
using to_spike_vector on sorting_equal test
a8842ea
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 497f150
removed the sorting since already sorted
df9d18f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a44726e
Merge branch 'main' into spike_vector_test_check_sorting_equal
alejoe91 1f523e8
restored lexsort
f75c3d4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 5578974
Remove lexsort
alejoe91 3e30777
remove _sorted_spike_vector
alejoe91 12b466e
Merge branch 'main' into spike_vector_test_check_sorting_equal
alejoe91 7c38893
Merge branch 'main' of github.com:SpikeInterface/spikeinterface into …
alejoe91 d7ae501
Force proper lexsort in generate and first to_spike_vector()
alejoe91 f520fea
Merge branch 'spike_vector_test_check_sorting_equal' of github.com:ta…
alejoe91 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,7 +174,7 @@ def generate_sorting( | |
| spikes.append(spikes_on_borders) | ||
|
|
||
| spikes = np.concatenate(spikes) | ||
| spikes = spikes[np.lexsort((spikes["sample_index"], spikes["segment_index"]))] | ||
| spikes = spikes[np.lexsort((spikes["unit_index"], spikes["sample_index"], spikes["segment_index"]))] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we were missing the unit index lexsort in generate |
||
|
|
||
| sorting = NumpySorting(spikes, sampling_frequency, unit_ids) | ||
|
|
||
|
|
||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -295,6 +295,8 @@ def __init__(self, folder_path: Path | str, storage_options: dict | None = None, | |
| spikes["unit_index"] = spikes_group["unit_index"][:] | ||
| for i, (start, end) in enumerate(segment_slices_list): | ||
| spikes["segment_index"][start:end] = i | ||
| spikes = spikes[np.lexsort((spikes["unit_index"], spikes["sample_index"], spikes["segment_index"]))] | ||
| self._cached_spike_vector = spikes | ||
|
Comment on lines
+298
to
+299
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and in zarr |
||
|
|
||
| for segment_index in range(num_segments): | ||
| soring_segment = SpikeVectorSortingSegment(spikes, segment_index, unit_ids) | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samuelgarcia I think it's better to lexsort the whole array at the end to make sure that units are also sorted within samples