-
Notifications
You must be signed in to change notification settings - Fork 272
Fix channel order bug and make select_channels private
#4712
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
base: main
Are you sure you want to change the base?
Changes from all commits
b84613b
f21e73f
cacbb31
66396fb
c9e1caa
9502b82
821aeb6
3132f3b
14d9a00
29a7d08
eb2c9f0
19e7243
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ | |
| from spikeinterface.core.sortinganalyzer import register_result_extension, AnalyzerExtension | ||
| from spikeinterface.core.core_tools import slice_rows | ||
| from spikeinterface.core.job_tools import TimeSeriesChunkExecutor, _shared_job_kwargs_doc, fix_job_kwargs | ||
| from spikeinterface.core.analyzer_extension_core import _inplace_sparse_realign_waveforms | ||
| from spikeinterface.core.analyzer_extension_core import _inplace_sparse_realign_waveforms, _select_channels_sparse_data | ||
|
|
||
| _possible_modes = ["by_channel_local", "by_channel_global", "concatenated"] | ||
|
|
||
|
|
@@ -98,6 +98,19 @@ def _select_units_extension_data(self, unit_ids): | |
| new_data[k] = v | ||
| return new_data | ||
|
|
||
| def _select_channels_extension_data(self, channel_ids): | ||
|
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. I have a strong intuition of copy/paste here.
Member
Author
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. Your intuition is correct - I've refactored |
||
|
|
||
| old_pcs = self.data["pca_projection"] | ||
| new_pcs = _select_channels_sparse_data(self.sorting_analyzer, old_pcs, channel_ids) | ||
|
|
||
| data = {"pca_projection": new_pcs} | ||
|
|
||
| for key, value in self.data.items(): | ||
| if key != "pca_projection": | ||
| data[key] = value | ||
|
|
||
| return data | ||
|
|
||
| def _merge_extension_data( | ||
| self, merge_unit_groups, new_unit_ids, new_sorting_analyzer, keep_mask=None, verbose=False, **job_kwargs | ||
| ): | ||
|
|
||
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.
I suspect this fonction to be very very slow.
We are looping spike per spike!
Do we have some numbers about the time for doing this ?
Maybe this would devserve a generic numba kernel for waveforms and pca with parralelisation no ?
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.
The tricky thing is that
unit_sparsity_channel_indicescan be different lengths. So I'm not sure how to numba-fy this easily. I'll think...