Skip to content

Commit 7839fb6

Browse files
edenoCBroz1
andauthored
Fix filtering on labels (#1249)
* Fix filtering on labels * Update CHANGELOG.md * Update CHANGELOG.md Co-authored-by: Chris Broz <[email protected]> --------- Co-authored-by: Chris Broz <[email protected]>
1 parent 202249f commit 7839fb6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
of `DLCPoseEstimation` #1208
2222
- Spikesorting
2323
- Fix compatibility bug between v1 pipeline and `SortedSpikesGroup` unit
24-
filtering #1238
24+
filtering #1238, #1249
2525
- Speedup `get_sorting` on `CurationV1` #1246
2626
- Behavior
2727
- Implement pipeline for keypoint-moseq extraction of behavior syllables #1056

src/spyglass/spikesorting/analysis/v1/group.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,12 @@ def fetch_spike_data(
189189
]
190190

191191
# filter the spike times based on the labels if present
192-
for attr in ("curation_label", "label"): # v1, v0. if both, use v0
193-
group_labels = getattr(nwb_file[nwb_field_name], attr, None)
192+
for col in ("label", "curation_label"): # v0, v1 names
193+
if col in nwb_file[nwb_field_name].columns:
194+
group_labels = nwb_file[nwb_field_name][col]
195+
break
196+
else:
197+
group_labels = None
194198
if group_labels is not None:
195199
group_label_list = group_labels.to_list()
196200
include_unit = SortedSpikesGroup.filter_units(

0 commit comments

Comments
 (0)