Skip to content

QualityMetrics: store use_valid_periods param#4596

Open
alejoe91 wants to merge 49 commits into
SpikeInterface:mainfrom
alejoe91:qm-store-use-valid-unit-periods
Open

QualityMetrics: store use_valid_periods param#4596
alejoe91 wants to merge 49 commits into
SpikeInterface:mainfrom
alejoe91:qm-store-use-valid-unit-periods

Conversation

@alejoe91
Copy link
Copy Markdown
Member

Currently, if use_valid_periods is given, the periods are retrieved from the valid_unit_periods extensions and stored as params, but this adds an ambiguity since there is no way to tell a posteriori if periods used for computing quality metrics were actually valid unit periods or externally defined periods. This PR simply propagates the param so it gets saved to the extension.

@alejoe91 alejoe91 added the metrics Related to metrics module label May 27, 2026
@alejoe91 alejoe91 requested a review from h-mayorquin May 27, 2026 13:23
@alejoe91 alejoe91 changed the title QualityMetrics: store use_valid_perioss param QualityMetrics: store use_valid_periods param May 27, 2026
Copy link
Copy Markdown
Collaborator

@h-mayorquin h-mayorquin left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines 120 to +121
if periods is not None:
raise ValueError("If use_valid_periods is True, periods should not be provided.")
periods = self.sorting_analyzer.get_extension("valid_unit_periods").get_data(outputs="numpy")
provided_periods = cast_periods_to_unit_period_dtype(np.asarray(periods))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a reason for allowing the user to pass use_valid_periods and periods now? Something to do with reloading??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metrics Related to metrics module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants