Skip to content

Commit

Permalink
Merge 032b8d6 into a470847
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis A. Engemann committed Feb 17, 2014
2 parents a470847 + 032b8d6 commit f1f8c2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions mne/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ def _read_events_fif(fid, tree):
else:
mappings = None

if mappings is not None:
m_ = (m.split(':') for m in mappings.split(';'))
mappings = dict((k, int(v)) for k, v in m_)
if mappings is not None: # deal with ':' in keys
m_ = [[s[::-1] for s in m[::-1].split(':', 1)]
for m in mappings.split(';')]
mappings = dict((k, int(v)) for v, k in m_)
event_list = event_list.reshape(len(event_list) // 3, 3)
return event_list, mappings

Expand Down
2 changes: 1 addition & 1 deletion mne/tests/test_epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test_read_write_epochs():
assert_equal(epochs_read.event_id, epochs.event_id)

epochs.event_id.pop('1')
epochs.event_id.update({'a': 1})
epochs.event_id.update({'a:a': 1}) # test allow for ':' in key
epochs.save(op.join(tempdir, 'foo-epo.fif'))
epochs_read2 = read_epochs(op.join(tempdir, 'foo-epo.fif'))
assert_equal(epochs_read2.event_id, epochs.event_id)
Expand Down

0 comments on commit f1f8c2c

Please sign in to comment.