Skip to content

Commit

Permalink
Merge pull request SpikeInterface#3495 from OlivierPeron/Loading-temp…
Browse files Browse the repository at this point in the history
…lates

Template loading average or median
  • Loading branch information
alejoe91 authored Oct 23, 2024
2 parents bfe9fb6 + 72357a6 commit 4a1a45a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/spikeinterface/core/template_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ def get_dense_templates_array(one_object: Templates | SortingAnalyzer, return_sc
)
ext = one_object.get_extension("templates")
if ext is not None:
templates_array = ext.data["average"]
if "average" in ext.data:
templates_array = ext.data.get("average")
elif "median" in ext.data:
templates_array = ext.data.get("median")
else:
raise ValueError("Average or median templates have not been computed.")
else:
raise ValueError("SortingAnalyzer need extension 'templates' to be computed to retrieve templates")
else:
Expand Down

0 comments on commit 4a1a45a

Please sign in to comment.