Skip to content

undead vampire meas date #4949

Closed
Closed

Description

@jasmainak

I'm just borrowing terminology from chat with @dengemann for title :-)

I seem to have hit a bug when writing tests for mne-bids. Essentially, if you set meas_date to None, when writing the file, MNE is using the current date/time to set it. Therefore, when you read it back, it's not None anymore. I would consider it a bug but feel free to disagree :) To reproduce, run this:

import os.path as op

import mne
from mne.datasets import sample
from mne.utils import _TempDir

data_path = sample.data_path()

raw_fname = op.join(data_path, 'MEG', 'sample', 'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(raw_fname)

# Let's make meas_date None
raw.info['meas_date'] = None
# raw.info['meas_id'] = None  # even uncommenting this does not change anything

# write it to a temp file
data_path2 = _TempDir()
raw_fname2 = op.join(data_path2, 'sample_audvis_raw.fif')
raw.save(raw_fname2, overwrite=True)

# and read it back
raw2 = mne.io.read_raw_fif(raw_fname2)
assert(raw.info['meas_date'] == raw2.info['meas_date'])

cc @teonbrooks

Activity

  1. christianbrodbeck commented on Feb 20, 2018

    @christianbrodbeck
    Member

    Sounds like that might be what prevented #2564 from working

  2. jasmainak commented on Feb 20, 2018

    @jasmainak
    MemberAuthor

    oh boy ...

  3. agramfort commented on Feb 20, 2018

    @agramfort
    SponsorMember
  4. added this to the 0.16 milestone on Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions