Extend docstrings for amplitude scaling and collisions#2893
Extend docstrings for amplitude scaling and collisions#2893alejoe91 merged 29 commits intoSpikeInterface:mainfrom
Conversation
…/JoeZiminski/spikeinterface into amplitude_scaling_collisions_fix
Co-authored-by: Zach McKenzie <92116279+zm711@users.noreply.github.com>
…nski/spikeinterface into amplitude_scaling_collisions_fix
|
Thanks Joe! I'd be happy to discuss about this during the hackahton. I brief comment about the |
h-mayorquin
left a comment
There was a problem hiding this comment.
Thanks a lot for doing this. I learn from these efforts as I have not used the methods myself.
…waveform amplitude.
|
Thanks @h-mayorquin! I've addressed the points and used a bullet-point approach for the definitions I agree much clearer now, let me know what you think! Cheers @alejoe91 I agree if these are not really in-use functions it does not make as much sense to add to the maintainability burden by adding tests for them. Do you think these would be useful enough to add as general widgets? Happy to do this, otherwise, do you think they could be moved to a personal repo? I'm conflicted, as I can see the use of having quick debugging functions in the main codebase, but if they are in the main codebase they should have some tests to check they don't become stale / unusable. But then, this adds maintainability burden 🤔 |
h-mayorquin
left a comment
There was a problem hiding this comment.
To me this is clearly an improvement. Some final comments but this is good to go for me.
|
Thanks everyone for their feedback! @alejoe91 I think this is good to go, currently the |
|
Thanks for the clarifications @JoeZiminski! I agree that this function was a bit obscure..it's very nice to see additional eyes on it! We can keep the TODOs for a follow up, ok? |
|
Sure sounds good @alejoe91, thanks for this! |
In investigating #2882 I had some trouble understanding what the code around amplitude scalings and fit collisions. The code itself is easy to follow, but there is a lack of context and supporting information on data structures which can make it tricky to understand what is going on without breaking into the code. I think I'll add the fix for #2882 in a different PR so the scope does not become too large.
This PR:
find_collisions,fit_collisionandAmplitudeScalingclasses and adds a few extra explanatory comments.Some questions:
collisionsstructure being the spike of interest. If the code is refactored in a way that changes this by accident, it will be difficult to track down but have major negative affect (all amplitude scalings will be wrong). Make the structure ofcollisionscan be changed, so this has two entries (spike) and (colliding_spikes). This imo would make this more robust in future.spikesstructure is an array with entriesAn array of spikes (sample_index, channel_index, amplitude, segment_index, unit_index, in_margin). I had added this explicitly to docstrings (initially, I just assumed it was array of indexes). But, there is now some duplication in the docstring, personally I don't think this too bad a thing, but might be a point for discussion.Update before merge