Skip to content

Commit e4dac22

Browse files
author
kleinjohann
committed
Account for multiple columns in _parse_header
1 parent 2a9cfc2 commit e4dac22

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

neo/rawio/phyrawio.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,18 @@ def _parse_header(self):
138138

139139
# Loop over list of list of dict and annotate each st
140140
for annotation_list in annotation_lists:
141-
clust_key, property_name = tuple(annotation_list[0].
142-
keys())
143-
if property_name == 'KSLabel':
144-
annotation_name = 'quality'
145-
else:
146-
annotation_name = property_name.lower()
147-
for annotation_dict in annotation_list:
148-
if int(annotation_dict[clust_key]) == clust_id:
149-
spiketrain_an[annotation_name] = \
150-
annotation_dict[property_name]
151-
break
141+
clust_key, *property_names = tuple(annotation_list[0].
142+
keys())
143+
for property_name in property_names:
144+
if property_name == 'KSLabel':
145+
annotation_name = 'quality'
146+
else:
147+
annotation_name = property_name.lower()
148+
for annotation_dict in annotation_list:
149+
if int(annotation_dict[clust_key]) == clust_id:
150+
spiketrain_an[annotation_name] = \
151+
annotation_dict[property_name]
152+
break
152153

153154
def _segment_t_start(self, block_index, seg_index):
154155
assert block_index == 0

0 commit comments

Comments
 (0)