Skip to content

Commit 36a8bda

Browse files
authored
fix fetch efficiency in insert_curation (#1072)
* fix fetch efficiency in insert_curation * update changelog
1 parent f5b6249 commit 36a8bda

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ PositionGroup.alter()
9696
- Add `UnitAnnotation` table and naming convention for units #1027, #1052
9797
- Set `sparse` parameter to waveform extraction step in `spikesorting.v1`
9898
#1039
99+
- Efficiency improvement to `v0.Curation.insert_curation` #1072
99100

100101
## [0.5.2] (April 22, 2024)
101102

src/spyglass/spikesorting/v0/spikesorting_curation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def insert_curation(
145145
Curation.insert1(sorting_key, skip_duplicates=True)
146146

147147
# get the primary key for this curation
148-
c_key = Curation.fetch("KEY")[0]
148+
c_key = (Curation & sorting_key).fetch1("KEY")
149149
curation_key = {item: sorting_key[item] for item in c_key}
150150

151151
return curation_key

0 commit comments

Comments
 (0)