Skip to content

Commit

Permalink
FIX: Update names
Browse files Browse the repository at this point in the history
  • Loading branch information
larsoner committed Jul 10, 2018
1 parent a3b2587 commit db6a0c3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
10 changes: 5 additions & 5 deletions mne/epochs.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ def _save_split(epochs, fname, part_idx, n_parts):
# undo modifications to data
data /= decal[np.newaxis, :, np.newaxis]

write_string(fid, FIFF.FIFFB_MNE_EPOCHS_DROP_LOG,
write_string(fid, FIFF.FIFF_MNE_EPOCHS_DROP_LOG,
json.dumps(epochs.drop_log))

write_int(fid, FIFF.FIFFB_MNE_EPOCHS_SELECTION,
write_int(fid, FIFF.FIFF_MNE_EPOCHS_SELECTION,
epochs.selection)

# And now write the next file info in case epochs are split on disk
Expand Down Expand Up @@ -2465,10 +2465,10 @@ def _read_one_epoch_file(f, tree, preload):
# Constant 305 was used before v0.11
tag = read_tag(fid, pos)
bmax = float(tag.data)
elif kind == FIFF.FIFFB_MNE_EPOCHS_SELECTION:
elif kind == FIFF.FIFF_MNE_EPOCHS_SELECTION:
tag = read_tag(fid, pos)
selection = np.array(tag.data)
elif kind == FIFF.FIFFB_MNE_EPOCHS_DROP_LOG:
elif kind == FIFF.FIFF_MNE_EPOCHS_DROP_LOG:
tag = read_tag(fid, pos)
drop_log = json.loads(tag.data)

Expand Down Expand Up @@ -2508,7 +2508,7 @@ def _read_one_epoch_file(f, tree, preload):
tmax = last / info['sfreq']
event_id = (dict((str(e), e) for e in np.unique(events[:, 2]))
if mappings is None else mappings)
# In case epochs didn't have a FIFF.FIFFB_MNE_EPOCHS_SELECTION tag
# In case epochs didn't have a FIFF.FIFF_MNE_EPOCHS_SELECTION tag
# (version < 0.8):
if selection is None:
selection = np.arange(len(events))
Expand Down
8 changes: 4 additions & 4 deletions mne/io/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -848,11 +848,11 @@ def __setattr__(self, attr, val): # noqa: D105
FIFF.FIFF_MNE_RT_CLIENT_ID = 3701 # realtime client

# MNE epochs bookkeeping
FIFF.FIFFB_MNE_EPOCHS_SELECTION = 3800 # the epochs selection
FIFF.FIFFB_MNE_EPOCHS_DROP_LOG = 3801 # the drop log
FIFF.FIFF_MNE_EPOCHS_SELECTION = 3800 # the epochs selection
FIFF.FIFF_MNE_EPOCHS_DROP_LOG = 3801 # the drop log

# MNE annotations
FIFF.FIFFB_MNE_ANNOTATIONS = 3810 # annotations
FIFF.FIFFB_MNE_ANNOTATIONS = 3810 # annotations block

# MNE Metadata Dataframes
FIFF.FIFFB_MNE_METADATA = 3811 # metadata dataframes
FIFF.FIFFB_MNE_METADATA = 3811 # metadata dataframes block
5 changes: 1 addition & 4 deletions mne/io/tests/test_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,7 @@ def test_constants(tmpdir):
elif name.startswith('FIFFB_'):
# We put these in the tag section rather than the IOD/block section
# -> XXX fix this by moving them to the IOD files in fiff-constants
if name in ('FIFFB_MNE_ANNOTATIONS',
'FIFFB_MNE_EPOCHS_DROP_LOG',
'FIFFB_MNE_EPOCHS_SELECTION',
'FIFFB_MNE_METADATA'):
if name in 'FIFFB_MNE_ANNOTATIONS':
assert val in tags
continue
assert val in iod, (val, name)
Expand Down

0 comments on commit db6a0c3

Please sign in to comment.