File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
element_array_ephys/export/nwb Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -113,8 +113,8 @@ def add_electrodes_to_nwb(session_key: dict, nwbfile: pynwb.NWBFile):
113
113
for this_probe in (ephys .ProbeInsertion * probe .Probe & session_key ).fetch (
114
114
as_dict = True
115
115
):
116
- insertion_record = (ephys .InsertionLocation & this_probe ).fetch1 ()
117
- if insertion_record :
116
+ insertion_record = (ephys .InsertionLocation & this_probe ).fetch ()
117
+ if len ( insertion_record ) == 1 :
118
118
insert_location = json .dumps (
119
119
{
120
120
k : v
@@ -123,8 +123,10 @@ def add_electrodes_to_nwb(session_key: dict, nwbfile: pynwb.NWBFile):
123
123
},
124
124
cls = DecimalEncoder ,
125
125
)
126
- else :
126
+ elif len ( insertion_record ) == 0 :
127
127
insert_location = "unknown"
128
+ else :
129
+ raise DataJointError (f'Found multiple insertion locations for { this_probe } ' )
128
130
129
131
device = nwbfile .create_device (
130
132
name = this_probe ["probe" ],
You can’t perform that action at this time.
0 commit comments