Add peaks_on_probe widget.#3022
Merged
alejoe91 merged 2 commits intoSpikeInterface:mainfrom Jun 21, 2024
Merged
Conversation
alejoe91
reviewed
Jun 12, 2024
alejoe91
requested changes
Jun 13, 2024
Member
alejoe91
left a comment
There was a problem hiding this comment.
Thanks @JoeZiminski
This is great! I have a few comments to be addressed :)
zm711
reviewed
Jun 18, 2024
Member
zm711
left a comment
There was a problem hiding this comment.
One tiny discussion point and one docstring patch.
2603db6 to
8a7c145
Compare
Collaborator
Author
|
@alejoe91 @samuelgarcia I squashed all commits into a single one that adds everything, then added a second one that removes the tests. If you are happy to add in this widget alone, the tests can be resurrected after the big refactoring. Assuming its okay to proceed like this, if this PR can be normal merged (not squash-merged) I'll refer to the commit that removes the test in issue #2986 to keep it tracked for posterity (although this is not strictly necessary if its a problem as I have a backup). |
alejoe91
approved these changes
Jun 21, 2024
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.
This PR adds a 'Peaks on Probe' widget that plots the peak locations overlaid on a plot of the probe (I am not a huge fan of the name myself, feel free to suggest others!). This PR closes #2986.
This plot has come up a few times in documentation and tutorials so I think could be a handy plotting function to have. A nice future addition would be to color-by-unit but if understand correctly from @samuelgarcia this is not currently possible as peaks do not hold unit. For me it is okay to include as-is and refine later if desired, the main reason I would like it is to import and call it from the motion/drift tutorial in #2879.
Overview
The function works by taking two main inputs, pre-calculated 'peaks' and corresponding 'peak_locations'. This can be either a single one of each or a list of corresponding entries. If multiple peaks / peak locations are passed, they are plot on different column axes of the same plot.
It is optional to select to only plot peaks from a certain segment, or between two times, to restrict the y-axis limits and to handle how peaks are decimated before plotting.
Questions
I think I might be using
make_mpl_figure()wrong, I am performing 1 index operation to move theAxesobjects to a 1d array here. Is this okay?