mne-tools/mne-python — pull request #429 by Eric89GXL (2013-02-03 00:04:25+00:00)
Title: FIX: Addressing raw reading regression

@agramfort I was apparently too hasty in one assumption I made about raw reading. Specifically, the line `if this['ent'] is None:` when reading through `raw.rawdirs` can happen even if the skip is not being read (!). I had changed this to throw an error in a previous PR, since I thought that should only happen if skip was being read.

The behavior I have it set to now is to wait until it gets a valid tag to choose the dtype (which fixes what would have been a regression before regarding assuming real dtype), and if no valid tags are ever read, it will return an array of zeros of the correct size. I could also have it throw a warning if no valid tags are ever read if we want.

It's a little hard to discern the changes I made since GitHub tracks indentation changes poorly. Basically I 1) indented the reading lines in one more, to only run if the tag is not `None` (whereas before having it be `None` would have thrown an error), 2) moved the allocation to a helper function since it is now used in two places (on demand after finding a good tag, or after all tags are found to be invalid), and 3) speeding/cleaning up the calibration lines a tiny bit by moving it outside the loop.

In any case, we don't have a test file with this property, so I can't really add a test for it. And I'm not the sole owner of the data file that I found the error on, so I can't add that to the test suite... but I can at least verify it now works on the file that used to throw an error.