Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 6, 2024
1 parent df67578 commit 31f98d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/spikeinterface/core/analyzer_extension_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def get_templates(self, unit_ids=None, save=True):
The returned templates (num_units, num_samples, num_channels)
"""

templates = self.data['average']
templates = self.data["average"]

if save:
self.save()
Expand Down
8 changes: 6 additions & 2 deletions src/spikeinterface/exporters/to_phy.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,15 @@ def export_to_phy(
if templates_ext is None:
templates_ext = sorting_analyzer.get_extension("fast_templates")
if templates_ext is not None and template_mode != "average":
assert False, "export_to_phy with SortingAnalyzer with extension 'fast_templates' can only work with template_mode='average'"
assert (
False
), "export_to_phy with SortingAnalyzer with extension 'fast_templates' can only work with template_mode='average'"
dense_templates = templates_ext.get_templates(unit_ids=unit_ids)
else:
dense_templates = templates_ext.get_templates(unit_ids=unit_ids, operator=template_mode)
assert templates_ext is not None, "export_to_phy need SortingAnalyzer with extension 'templates' or 'fast_templates'"
assert (
templates_ext is not None
), "export_to_phy need SortingAnalyzer with extension 'templates' or 'fast_templates'"
max_num_channels = max(len(chan_inds) for chan_inds in sparse_dict.values())
num_samples = dense_templates.shape[1]
templates = np.zeros((len(unit_ids), num_samples, max_num_channels), dtype="float64")
Expand Down

0 comments on commit 31f98d6

Please sign in to comment.