Skip to content

Commit 83c6b46

Browse files
authored
Remove pre-existing units from analysis files (#1453)
* pop off existing units from analysis files * update changelog
1 parent 27c8b0a commit 83c6b46

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ DecodingParameters().alter()
5757
- Add custom/dynamic `AnalysisNwbfile` creation #1435
5858
- Allow nullable `DataAcquisitionDevice` foreign keys #1455
5959
- Improve error transparency on duplicate `Electrode` ids #1454
60+
- Remove pre-existing `Units` from created analysis nwb files #1453
6061
- Allow multiple VideoFile entries during ingestion #1462
6162
- Decoding
6263
- Ensure results directory is created if it doesn't exist #1362

src/spyglass/utils/mixins/analysis.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ def create(
209209
if isinstance(nwb_object, pynwb.core.LabelledDict):
210210
for module in list(nwb_object.keys()):
211211
nwb_object.pop(module)
212+
# Remove units to avoid conflict with spyglass-managed spikesorting
213+
if field == "units":
214+
nwbf._remove_child(nwb_object)
215+
nwbf.fields[field] = None
212216

213217
# pop off optogenetic_epochs if it exists
214218
if (

0 commit comments

Comments
 (0)