Skip to content
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

Extend and refactor waveform metrics #1993

Merged
merged 12 commits into from
Oct 16, 2023

Conversation

alejoe91
Copy link
Member

@alejoe91 alejoe91 commented Sep 13, 2023

Implemented additional metrics:

Single-channel

  • num_positive_peaks
  • num_negative_peaks

Multi-channel

  • velocity_above
  • velocity_below
  • spread
  • exp_decay

Closes #1185

@alejoe91 alejoe91 added the postprocessing Related to postprocessing module label Sep 13, 2023
@alejoe91 alejoe91 marked this pull request as ready for review September 22, 2023 10:20
@alejoe91 alejoe91 added the enhancement New feature or request label Sep 29, 2023
Copy link
Collaborator

@zm711 zm711 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a partial update of some of the docstrings (a few typos and added in the sampling_frequency parameter into the parameters section, but maybe there was a reason why you didn't want them so feel free to delete those they are not needed.

src/spikeinterface/postprocessing/template_metrics.py Outdated Show resolved Hide resolved
src/spikeinterface/postprocessing/template_metrics.py Outdated Show resolved Hide resolved
src/spikeinterface/postprocessing/template_metrics.py Outdated Show resolved Hide resolved
src/spikeinterface/postprocessing/template_metrics.py Outdated Show resolved Hide resolved
src/spikeinterface/postprocessing/template_metrics.py Outdated Show resolved Hide resolved
src/spikeinterface/postprocessing/template_metrics.py Outdated Show resolved Hide resolved
src/spikeinterface/postprocessing/template_metrics.py Outdated Show resolved Hide resolved
src/spikeinterface/postprocessing/template_metrics.py Outdated Show resolved Hide resolved
src/spikeinterface/postprocessing/template_metrics.py Outdated Show resolved Hide resolved
src/spikeinterface/postprocessing/template_metrics.py Outdated Show resolved Hide resolved
@alejoe91
Copy link
Member Author

alejoe91 commented Oct 2, 2023

Thanks @zm711

Aplied the suggested changes. @samuelgarcia @h-mayorquin good to merge

@@ -2016,6 +2032,9 @@ def set_params(self, **params):
params = self._set_params(**params)
self._params = params

if self.waveform_extractor.is_read_only():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should run error instead no ?
set_params on read only should be allowed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is allowed, but only in mem in this case

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

henestly set_params to a read only should be not aalowed.
What is the use here ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It skips saving to disk!

sparsity: Optional[ChannelSparsity] = None,
include_multi_channel_metrics: bool = False,
metrics_kwargs: dict = None,
debug_plots: bool = False,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am OK to have debug_plot inside the code at the tricky places but I would avoid this in the signauture

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I can remove it and set it as a flag on top of the file

@samuelgarcia samuelgarcia merged commit 3f11037 into SpikeInterface:main Oct 16, 2023
8 checks passed
@alejoe91 alejoe91 deleted the extended-template-metrics branch October 17, 2023 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request postprocessing Related to postprocessing module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat-postprocessing]: implement missing template metrics
3 participants