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

Change phy exporter to not save template_ind in the case of dense waveform_extractor #2148

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

zm711
Copy link
Collaborator

@zm711 zm711 commented Oct 31, 2023

Fixes #2023. Just trying to do a cleanup of the issue tracker for 0.99.0. Definitely could go later though.

2 things in this PR

  1. As discussed in Dense vs Sparse template file saving for export_to_phy #2023, there is no point in saving the template_ind.npy if the data is dense since it is suppose to be the sparsity for phy. So I just set a boolean to not save template_ind.npy if the waveform extractor is dense. Phy will use the lack of template_ind.npy to treat it as a dense dataset so Phy's behavior isn't affected (might even be improved since it will treat the data as dense from the get go).

  2. with the new default of sparse=True (for extract_waveforms()), I'm a little worried that users might not realize their input waveform_extractor is automatically sparse and they might try to layer a sparsity on top. In this case rather than stop the program with an assert I changed it to a warning, so that people know the waveform_extractor is already sparse. But if you want the assert instead that can be reverted.

@zm711 zm711 added the exporters Related to exporters module label Oct 31, 2023
if waveform_extractor.is_sparse():
used_sparsity = waveform_extractor.sparsity
assert sparsity is None
if sparsity is not None:
warnings.warn("If the waveform_extractor is sparse the 'sparsity' argument is ignored")
Copy link
Member

Choose a reason for hiding this comment

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

Great idea!

@alejoe91 alejoe91 added this to the 0.99.0 milestone Nov 2, 2023
@alejoe91 alejoe91 merged commit 144945d into SpikeInterface:main Nov 2, 2023
@zm711 zm711 deleted the export-phy branch November 2, 2023 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporters Related to exporters module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dense vs Sparse template file saving for export_to_phy
2 participants