Skip to content

Commit 82c8655

Browse files
committed
fix insertion record
1 parent 707adff commit 82c8655

File tree

1 file changed

+4
-4
lines changed
  • element_array_ephys/export/nwb

1 file changed

+4
-4
lines changed

element_array_ephys/export/nwb/nwb.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,17 @@ def add_electrodes_to_nwb(session_key: dict, nwbfile: pynwb.NWBFile):
113113
for this_probe in (ephys.ProbeInsertion * probe.Probe & session_key).fetch(
114114
as_dict=True
115115
):
116-
insertion_record = (ephys.InsertionLocation & this_probe).fetch()
117-
if len(insertion_record)==1:
116+
insertion_record = (ephys.InsertionLocation & this_probe).fetch(as_dict=True)
117+
if len(insertion_record) == 1:
118118
insert_location = json.dumps(
119119
{
120120
k: v
121-
for k, v in insertion_record.items()
121+
for k, v in insertion_record[0].items()
122122
if k not in ephys.InsertionLocation.primary_key
123123
},
124124
cls=DecimalEncoder,
125125
)
126-
elif len(insertion_record)==0:
126+
elif len(insertion_record) == 0:
127127
insert_location = "unknown"
128128
else:
129129
raise DataJointError(f'Found multiple insertion locations for {this_probe}')

0 commit comments

Comments
 (0)