diff --git a/src/spyglass/spikesorting/v0/spikesorting_curation.py b/src/spyglass/spikesorting/v0/spikesorting_curation.py index e3c0a6fd6..acdebe352 100644 --- a/src/spyglass/spikesorting/v0/spikesorting_curation.py +++ b/src/spyglass/spikesorting/v0/spikesorting_curation.py @@ -513,10 +513,13 @@ class QualityMetrics(SpyglassMixin, dj.Computed): """ def make(self, key): - key["analysis_file_name"] = AnalysisNwbfile().create( # logged + analysis_file_name = AnalysisNwbfile().create( # logged key["nwb_file_name"] ) waveform_extractor = Waveforms().load_waveforms(key) + key["analysis_file_name"] = ( + analysis_file_name # add to key here to prevent fetch errors + ) qm = {} params = (MetricParameters & key).fetch1("metric_params") for metric_name, metric_params in params.items():