internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: mne-tools/mne-python

Issue:
BUG: 2GB limit can be exceeded
...on writes, which can leave us with un-readable files on read. See e.g. #1849.



Discussion:
To recreate the problem (note: creates a huge file in memory and on disk):

``` Python
import numpy as np
import mne

n_ch = 64
n_times_epo = 1024
n_needed = (2 ** 31) // (4 * n_ch) + n_times_epo  # make sure we go over
n_epochs = n_needed // n_times_epo
info = mne.create_info([str(x) for x in range(n_ch)], 1.)
raw = mne.io.RawArray(np.zeros((n_ch, n_times_epo), np.float32), info)
events = np.tile(np.atleast_2d([0, 0, 1]), (n_epochs, 1))
epochs = mne.Epochs(raw, events, 1, 0, n_times_epo - 1)
epochs.save('test-epo.fif')
epochs = mne.read_epochs('test-epo.fif')
```

Result:

``` Python
  File "/home/larsoner/.local/lib/python2.7/site-packages/mne/io/tag.py", line 147, in read_tag_info
    fid.seek(tag.size, 1)
IOError: [Errno 22] Invalid argument
```

@agramfort would it be good enough for now to add a check to the FIFF-ending function that checks the file size and throws an error if the limit is exceeded?

maybe :)


Resolving patch:
diff --git a/mne/io/write.py b/mne/io/write.py
--- a/mne/io/write.py
+++ b/mne/io/write.py
@@ -118,6 +118,7 @@ def write_float_matrix(fid, kind, mat):
     dims[:mat.ndim] = mat.shape[::-1]
     dims[-1] = mat.ndim
     fid.write(np.array(dims, dtype='>i4').tostring())
+    check_fiff_length(fid)
 
 
 def write_double_matrix(fid, kind, mat):
@@ -137,6 +138,7 @@ def write_double_matrix(fid, kind, mat):
     dims[:mat.ndim] = mat.shape[::-1]
     dims[-1] = mat.ndim
     fid.write(np.array(dims, dtype='>i4').tostring())
+    check_fiff_length(fid)
 
 
 def write_int_matrix(fid, kind, mat):
@@ -157,6 +159,7 @@ def write_int_matrix(fid, kind, mat):
     dims[1] = mat.shape[0]
     dims[2] = 2
     fid.write(np.array(dims, dtype='>i4').tostring())
+    check_fiff_length(fid)
 
 
 def get_machid():
@@ -243,6 +246,15 @@ def start_file(fname, id_=None):
     return fid
 
 
+def check_fiff_length(fid, close=True):
+    """Ensure our file hasn't grown too large to work properly"""
+    if fid.tell() > 2147483648:  # 2 ** 31, FIFF uses signed 32-bit locations
+        if close:
+            fid.close()
+        raise IOError('FIFF file exceeded 2GB limit, please split file or '
+                      'save to a different format')
+
+
 def end_file(fid):
     """Writes the closing tags to a fif file and closes the file"""
     data_size = 0
@@ -250,6 +262,7 @@ def end_file(fid):
     fid.write(np.array(FIFF.FIFFT_VOID, dtype='>i4').tostring())
     fid.write(np.array(data_size, dtype='>i4').tostring())
     fid.write(np.array(FIFF.FIFFV_NEXT_NONE, dtype='>i4').tostring())
+    check_fiff_length(fid)
     fid.close()
 
 
@@ -345,6 +358,7 @@ def write_float_sparse_rcs(fid, kind, mat):
 
     dims = [nnzm, mat.shape[0], mat.shape[1], 2]
     fid.write(np.array(dims, dtype='>i4').tostring())
+    check_fiff_length(fid)
 
 
 def _generate_meas_id():


Test patch:
Repository: mne-tools/mne-python

Issue:
check extension of brainvision file
I mistakenly tried:

raw = mne.io.read_raw_brainvision('test.vmrk')

instead of

raw = mne.io.read_raw_brainvision('test.vhdr')

and got this error, which is not super explicit:

--> 402         assert l == 'Brain Vision Data Exchange Header File Version 1.0'

to help here we should check file extension and use a properly exception (not this assert).

@teonlamont can you take care of that?

thanks heaps.



Discussion:

Resolving patch:
diff --git a/mne/io/brainvision/brainvision.py b/mne/io/brainvision/brainvision.py
--- a/mne/io/brainvision/brainvision.py
+++ b/mne/io/brainvision/brainvision.py
@@ -396,6 +396,10 @@ def _get_eeg_info(vhdr_fname, eog, misc):
     info['filename'] = vhdr_fname
     eeg_info = {}
 
+    ext = os.path.splitext(vhdr_fname)[-1]
+    if ext != '.vhdr':
+        raise IOError("The header file must be given to read the data, "
+                      "not the '%s' file." % ext)
     with open(vhdr_fname, 'r') as f:
         # extract the first section to resemble a cfg
         l = f.readline().strip()


Test patch:
diff --git a/mne/io/brainvision/tests/test_brainvision.py b/mne/io/brainvision/tests/test_brainvision.py
--- a/mne/io/brainvision/tests/test_brainvision.py
+++ b/mne/io/brainvision/tests/test_brainvision.py
@@ -22,6 +22,7 @@
 FILE = inspect.getfile(inspect.currentframe())
 data_dir = op.join(op.dirname(op.abspath(FILE)), 'data')
 vhdr_path = op.join(data_dir, 'test.vhdr')
+vmrk_path = op.join(data_dir, 'test.vmrk')
 vhdr_highpass_path = op.join(data_dir, 'test_highpass.vhdr')
 montage = op.join(data_dir, 'test.hpts')
 eeg_bin = op.join(data_dir, 'test_bin_raw.fif')
@@ -42,6 +43,7 @@ def test_brainvision_data_filters():
 def test_brainvision_data():
     """Test reading raw Brain Vision files
     """
+    assert_raises(IOError, read_raw_brainvision, vmrk_path)
     assert_raises(TypeError, read_raw_brainvision, vhdr_path, montage,
                   preload=True, scale="0")
     raw_py = read_raw_brainvision(vhdr_path, montage, eog=eog, preload=True)
Repository: mne-tools/mne-python

Issue:
FIX: some TFR examples seem broken on master
stockwell and multitaper.

cc @agramfort @Eric89GXL 



Discussion:
No idea what's wrong here ... might be a blocker. We need to understand what's wrong.

Yeah we should definitely make sure all examples work and the doc builds, and not release until they do so. Hopefully we can take care of this and #1780 in the same pass.

broken? crash or weird output?

The outputs look wrong, see dev exapmles on webpage.

2015-04-20 12:58 GMT+02:00 Alexandre Gramfort notifications@github.com:

> broken? crash or weird output?
> 
> —
> Reply to this email directly or view it on GitHub
> https://github.com/mne-tools/mne-python/issues/1986#issuecomment-94422318
> .

we have a blocker here. Something went wrong maybe when refactoring
baselining or something

Any idea when it last looked okay? What is it supposed to look like? Is it supposed to look like the non-dev-docs version? If so, I can probably find time tomorrow to bisect and find the problem.

@Eric89GXL maybe before your cuda refacoting? Also didn't you also recently refactor some of this code. Maybe let's git praise (blame).

Can you describe briefly what it's supposed to look like?

![screenshot 2014-12-10 16 12 08](https://cloud.githubusercontent.com/assets/1908618/7309336/acd6f728-ea1d-11e4-87d3-bfd236189f99.png)

for the stockwell roughly

I think this was one original screenshot from the example:

![screenshot 2014-11-20 15 41 55](https://cloud.githubusercontent.com/assets/1908618/7309350/cfaf6dfc-ea1d-11e4-9032-e5f06f256339.png)

Here some info on the original MTM implementation, also plots.

https://github.com/mne-tools/mne-python/pull/1639

bisected the offending commit, naturally it's mine :)

https://github.com/dengemann/mne-python/commit/a19a954b3fbd5a38f5659ba5d294064129c2ea0a

working on it now


Resolving patch:
diff --git a/mne/time_frequency/tfr.py b/mne/time_frequency/tfr.py
--- a/mne/time_frequency/tfr.py
+++ b/mne/time_frequency/tfr.py
@@ -624,7 +624,7 @@ def crop(self, tmin=None, tmax=None, copy=False):
     @verbose
     def plot(self, picks=None, baseline=None, mode='mean', tmin=None,
              tmax=None, fmin=None, fmax=None, vmin=None, vmax=None,
-             cmap='RdBu_r', dB=True, colorbar=True, show=True,
+             cmap='RdBu_r', dB=False, colorbar=True, show=True,
              title=None, verbose=None):
         """Plot TFRs in a topography with images
 
@@ -706,7 +706,7 @@ def plot(self, picks=None, baseline=None, mode='mean', tmin=None,
 
     def plot_topo(self, picks=None, baseline=None, mode='mean', tmin=None,
                   tmax=None, fmin=None, fmax=None, vmin=None, vmax=None,
-                  layout=None, cmap='RdBu_r', title=None, dB=True,
+                  layout=None, cmap='RdBu_r', title=None, dB=False,
                   colorbar=True, layout_scale=0.945, show=True,
                   border='none', fig_facecolor='k', font_color='w'):
         """Plot TFRs in a topography with images


Test patch:
Repository: mne-tools/mne-python

Issue:
indexing Dipole
it would be great to be able index instances of Dipole e.g. to do:

`dipole[dipole.gof > 0.8].plot_locations()`

we should be able to do:

```
dipole[dipole.gof > 0.8]
dipole[:5]
```

as if we had 1d numpy array of dipoles.

@jmontoyam It would simplify your scripts.



Discussion:
@agramfort how urgently is this needed? It should be fairly straightforward so I could do it, but it might be good for a new contributor if they want to take it

I think @jmontoyam should give it a try as a first contrib.


Resolving patch:
diff --git a/mne/dipole.py b/mne/dipole.py
--- a/mne/dipole.py
+++ b/mne/dipole.py
@@ -190,6 +190,27 @@ def plot_amplitudes(self, color='k', show=True):
         from .viz import plot_dipole_amplitudes
         return plot_dipole_amplitudes([self], [color], show)
 
+    def __getitem__(self, idx_slice):
+        """Handle indexing"""
+        if isinstance(idx_slice, int):  # make sure attributes stay 2d
+            idx_slice = [idx_slice]
+
+        selected_times = self.times[idx_slice].copy()
+        selected_pos = self.pos[idx_slice, :].copy()
+        selected_amplitude = self.amplitude[idx_slice].copy()
+        selected_ori = self.ori[idx_slice, :].copy()
+        selected_gof = self.gof[idx_slice].copy()
+        selected_name = self.name
+
+        new_dipole = Dipole(selected_times, selected_pos,
+                            selected_amplitude, selected_ori,
+                            selected_gof, selected_name)
+        return new_dipole
+
+    def __len__(self):
+        """Handle len function"""
+        return self.pos.shape[0]
+
 
 # #############################################################################
 # IO


Test patch:
diff --git a/mne/tests/test_dipole.py b/mne/tests/test_dipole.py
--- a/mne/tests/test_dipole.py
+++ b/mne/tests/test_dipole.py
@@ -35,6 +35,14 @@ def _compare_dipoles(orig, new):
     assert_equal(orig.name, new.name)
 
 
+def _check_dipole(dip, n_dipoles):
+    assert_equal(len(dip), n_dipoles)
+    assert_equal(dip.pos.shape, (n_dipoles, 3))
+    assert_equal(dip.ori.shape, (n_dipoles, 3))
+    assert_equal(dip.gof.shape, (n_dipoles,))
+    assert_equal(dip.amplitude.shape, (n_dipoles,))
+
+
 @testing.requires_testing_data
 def test_io_dipoles():
     """Test IO for .dip files
@@ -124,4 +132,22 @@ def test_dipole_fitting():
     assert_true(amp_errs[0] >= amp_errs[1], 'amplitude errors: %s' % amp_errs)
     # assert_true(gofs[0] <= gofs[1], 'gof: %s' % gofs)
 
+
+@testing.requires_testing_data
+def test_len_index_dipoles():
+    """Test len and indexing of Dipole objects
+    """
+    dipole = read_dipole(fname_dip)
+    d0 = dipole[0]
+    d1 = dipole[:1]
+    _check_dipole(d0, 1)
+    _check_dipole(d1, 1)
+    _compare_dipoles(d0, d1)
+    mask = dipole.gof > 15
+    idx = np.where(mask)[0]
+    d_mask = dipole[mask]
+    _check_dipole(d_mask, 4)
+    _compare_dipoles(d_mask, dipole[idx])
+
+
 run_tests_if_main(False)
Repository: mne-tools/mne-python

Issue:
Q: `epochs_` in evoked name
I used to create epochs from a bunch of event types, then do multiple manipulations on them ending with:

```
evoked = epochs['condition_1'].average()
```

This used to give me an evoked instance where `evoked.name == 'condition_1'`, but now I get `evoked.name == 'epochs_condition_1'`. This seems like a backward-incompatible change, but somehow it has been around for over a year (`git blame` around line 1280 in `epochs.py` traces it back to @agramfort in January 2014). Is this intended behavior, or a bug? Should I just manually get rid of the `epochs_` prefix for my use case?



Discussion:
looks like a bug to me. This epochs_ should not be there :(

Do you remember the logic you were going for? It basically sets the name of the selected object based on whether or not the orginal object had a name != 'Unknown' (but not incorporating the original name at all). I'll go ahead and fix it. Should we backport to 0.9?


Resolving patch:
diff --git a/mne/epochs.py b/mne/epochs.py
--- a/mne/epochs.py
+++ b/mne/epochs.py
@@ -1276,8 +1276,7 @@ def __getitem__(self, key):
                                        'event matches all criteria.')
             select = np.any(np.atleast_2d([epochs._key_match(k)
                                            for k in key]), axis=0)
-            epochs.name = ('+'.join(key) if epochs.name == 'Unknown'
-                           else 'epochs_%s' % '+'.join(key))
+            epochs.name = '+'.join(key)
         else:
             select = key if isinstance(key, slice) else np.atleast_1d(key)
 


Test patch:
diff --git a/mne/tests/test_epochs.py b/mne/tests/test_epochs.py
--- a/mne/tests/test_epochs.py
+++ b/mne/tests/test_epochs.py
@@ -144,6 +144,7 @@ def test_epoch_combine_ids():
                     tmin, tmax, picks=picks, preload=False)
     events_new = merge_events(events, [1, 2], 12)
     epochs_new = combine_event_ids(epochs, ['a', 'b'], {'ab': 12})
+    assert_equal(epochs_new['ab'].name, 'ab')
     assert_array_equal(events_new, epochs_new.events)
     # should probably add test + functionality for non-replacement XXX
 
@@ -927,6 +928,10 @@ def test_access_by_name():
     assert_array_equal(epochs.events, epochs6.events)
     assert_array_almost_equal(epochs.get_data(), epochs6.get_data(), 20)
 
+    # Make sure we preserve names
+    assert_equal(epochs['a'].name, 'a')
+    assert_equal(epochs[['a', 'b']]['a'].name, 'a')
+
 
 @requires_pandas
 def test_to_data_frame():
Repository: mne-tools/mne-python

Issue:
BUG/API issue with multi_comp.bonferroni_correction
Do people agree that this is a bug, at least a very unexpected output:
https://github.com/mne-tools/mne-python/blob/master/mne/stats/multi_comp.py#L101

`pval_corrected` should instead be used for creating the output mask.

@agramfort @Eric89GXL @mainakjas 



Discussion:
indeed, looks like a bug to me

probably one of @agramfort 's early experiments on how to impvrove the sensitivity of MEG group analyses ... ;)

oh my goodness... it's a horrible bug that has been there for ages ... :-/

PR more than welcome...

Ok, I'm on it.


Resolving patch:
diff --git a/mne/stats/multi_comp.py b/mne/stats/multi_comp.py
--- a/mne/stats/multi_comp.py
+++ b/mne/stats/multi_comp.py
@@ -98,5 +98,5 @@ def bonferroni_correction(pval, alpha=0.05):
     """
     pval = np.asarray(pval)
     pval_corrected = pval * float(pval.size)
-    reject = pval < alpha
+    reject = pval_corrected < alpha
     return reject, pval_corrected


Test patch:
diff --git a/mne/stats/tests/test_multi_comp.py b/mne/stats/tests/test_multi_comp.py
--- a/mne/stats/tests/test_multi_comp.py
+++ b/mne/stats/tests/test_multi_comp.py
@@ -1,5 +1,6 @@
 import numpy as np
-from numpy.testing import assert_almost_equal, assert_allclose, assert_raises
+from numpy.testing import (
+    assert_almost_equal, assert_allclose, assert_raises, assert_array_equal)
 from nose.tools import assert_true
 from scipy import stats
 
@@ -25,6 +26,8 @@ def test_multi_pval_correction():
     assert_true(pval_bonferroni.ndim == 2)
     assert_true(reject_bonferroni.ndim == 2)
     assert_allclose(pval_bonferroni / 10000, pval)
+    reject_expected = pval_bonferroni < alpha
+    assert_array_equal(reject_bonferroni, reject_expected)
 
     fwer = np.mean(reject_bonferroni)
     assert_almost_equal(fwer, alpha, 1)
Repository: mne-tools/mne-python

Issue:
example broken due to viz changes
See eg plot_read_evoked.py

get : KeyError: 'eog'

@jaeilepp I suppose it's due to some recent changes you made. thanks for taking a look.



Discussion:

Resolving patch:
diff --git a/mne/viz/evoked.py b/mne/viz/evoked.py
--- a/mne/viz/evoked.py
+++ b/mne/viz/evoked.py
@@ -84,8 +84,8 @@ def _plot_evoked(evoked, picks, exclude, unit, show,
     scalings = _handle_default('scalings', scalings)
     titles = _handle_default('titles', titles)
     units = _handle_default('units', units)
-    channel_types = set(key for d in [scalings, titles, units] for key in d)
-    channel_types = sorted(channel_types)  # to guarantee consistent order
+    # Valid data types ordered for consistency
+    channel_types = ['eeg', 'grad', 'mag', 'seeg']
 
     if picks is None:
         picks = list(range(evoked.info['nchan']))


Test patch:
Repository: mne-tools/mne-python

Issue:
FIX: Deprecate raw.preload_data
For @teonlamont, to make sure we don't release 0.10 without it. From #2498.



Discussion:

Resolving patch:
diff --git a/mne/epochs.py b/mne/epochs.py
--- a/mne/epochs.py
+++ b/mne/epochs.py
@@ -329,7 +329,7 @@ def load_data(self):
 
         Notes
         -----
-        This function operates inplace.
+        This function operates in-place.
 
         .. versionadded:: 0.10.0
         """
diff --git a/mne/io/base.py b/mne/io/base.py
--- a/mne/io/base.py
+++ b/mne/io/base.py
@@ -37,7 +37,7 @@
 from ..utils import (_check_fname, _check_pandas_installed,
                      _check_pandas_index_arguments,
                      check_fname, _get_stim_channel, object_hash,
-                     logger, verbose, _time_mask)
+                     logger, verbose, _time_mask, deprecated)
 from ..viz import plot_raw, plot_raw_psd
 from ..defaults import _handle_default
 from ..externals.six import string_types
@@ -424,6 +424,28 @@ def _read_segment_file(self, data, idx, offset, fi, start, stop,
         """
         raise NotImplementedError
 
+    @deprecated("This method has been renamed 'load_data' and will be removed "
+                "in v0.11.")
+    def preload_data(self, verbose=None):
+        """Preload raw data
+
+        Parameters
+        ----------
+        verbose : bool, str, int, or None
+            If not None, override default verbose level (see mne.verbose).
+
+        Returns
+        -------
+        raw : instance of Raw
+            The raw object with data.
+
+        Notes
+        -----
+        This function will load raw data if it was not already preloaded.
+        If data were already preloaded, it will do nothing.
+        """
+        return self.load_data(verbose=verbose)
+
     @verbose
     def load_data(self, verbose=None):
         """Load raw data
@@ -442,6 +464,8 @@ def load_data(self, verbose=None):
         -----
         This function will load raw data if it was not already preloaded.
         If data were already preloaded, it will do nothing.
+
+        .. versionadded:: 0.10.0
         """
         if not self.preload:
             self._preload_data(True)


Test patch:
Repository: mne-tools/mne-python

Issue:
BUG: parts of our MNE-C forward workflow are missing in Python
Someone must have forgotten to implement this ;)
It's perfect for a lazy sunday hack, basiclaly convert a shell script to Python.



Discussion:
It's

mne_setup_forward_model

> mne_setup_forward_model

I wanted to keep it interesting ;)

@lorenzo-desantis are you up for it?

Yes, but I don't think I'll be able to start right away!


Resolving patch:
diff --git a/mne/bem.py b/mne/bem.py
--- a/mne/bem.py
+++ b/mne/bem.py
@@ -281,7 +281,7 @@ def make_bem_solution(surfs, verbose=None):
     Parameters
     ----------
     surfs : list of dict
-        The BEM surfaces to use.
+        The BEM surfaces to use (`from make_bem_model`)
     verbose : bool, str, int, or None
         If not None, override default verbose level (see mne.verbose).
 
@@ -496,12 +496,16 @@ def make_bem_model(subject, ico=4, conductivity=(0.3, 0.006, 0.3),
                    subjects_dir=None, verbose=None):
     """Create a BEM model for a subject
 
+    .. note:: To get a single layer bem corresponding to the --homog flag in
+              the command line tool set the ``connectivity`` accordingly
+
     Parameters
     ----------
     subject : str
         The subject.
     ico : int | None
         The surface ico downsampling to use, e.g. 5=20484, 4=5120, 3=1280.
+        If None, no subsampling is applied.
     conductivity : array of int, shape (3,) or (1,)
         The conductivities to use for each shell. Should be a single element
         for a one-layer model, or three elements for a three-layer model.
diff --git a/mne/io/bti/bti.py b/mne/io/bti/bti.py
--- a/mne/io/bti/bti.py
+++ b/mne/io/bti/bti.py
@@ -1085,7 +1085,8 @@ def _get_bti_info(pdf_fname, config_fname, head_shape_fname, rotation_x,
                              ' whether you are in the right directory '
                              'or pass the full name' % config_fname)
 
-    if head_shape_fname is not None and not isinstance(pdf_fname, six.BytesIO):
+    if head_shape_fname is not None and not isinstance(
+            head_shape_fname, six.BytesIO):
         orig_name = head_shape_fname
         if not op.isfile(head_shape_fname):
             head_shape_fname = op.join(op.dirname(pdf_fname),


Test patch:
Repository: mne-tools/mne-python

Issue:
read_ica() fails for old ica with bad channels
Hello,
I got several old ICAs results computed with version 0.9 that I would like to load and apply. Unfortunately, loading using read_ica()  seems no longer possible. The error I get is: "bad channel(s) [...] marked do not exist in info". Here's a link to an example ICA file:
https://github.com/sstober/openmiir/raw/master/eeg/preprocessing/ica/P01-100p_64c-ica.fif
Cheers,
Sebastian



Discussion:

Resolving patch:
diff --git a/mne/io/meas_info.py b/mne/io/meas_info.py
--- a/mne/io/meas_info.py
+++ b/mne/io/meas_info.py
@@ -487,7 +487,7 @@ def read_bad_channels(fid, node):
 
 
 @verbose
-def read_meas_info(fid, tree, verbose=None):
+def read_meas_info(fid, tree, clean_bads=False, verbose=None):
     """Read the measurement info
 
     Parameters
@@ -496,6 +496,10 @@ def read_meas_info(fid, tree, verbose=None):
         Open file descriptor.
     tree : tree
         FIF tree structure.
+    clean_bads : bool
+        If True, clean info['bads'] before running consistency check.
+        Should only be needed for old files where we did not check bads
+        before saving.
     verbose : bool, str, int, or None
         If not None, override default verbose level (see mne.verbose).
 
@@ -881,6 +885,8 @@ def read_meas_info(fid, tree, verbose=None):
     #   All kinds of auxliary stuff
     info['dig'] = dig
     info['bads'] = bads
+    if clean_bads:
+        info['bads'] = [b for b in bads if b in info['ch_names']]
     info['projs'] = projs
     info['comps'] = comps
     info['acq_pars'] = acq_pars
diff --git a/mne/preprocessing/ica.py b/mne/preprocessing/ica.py
--- a/mne/preprocessing/ica.py
+++ b/mne/preprocessing/ica.py
@@ -50,6 +50,10 @@
 from ..externals.six import string_types, text_type
 
 
+__all__ = ['ICA', 'ica_find_ecg_events', 'ica_find_eog_events',
+           'get_score_funcs', 'read_ica', 'run_ica']
+
+
 def _make_xy_sfunc(func, ndim_output=False):
     """Aux function"""
     if ndim_output:
@@ -82,10 +86,6 @@ def get_score_funcs():
     return score_funcs
 
 
-__all__ = ['ICA', 'ica_find_ecg_events', 'ica_find_eog_events',
-           'get_score_funcs', 'read_ica', 'run_ica']
-
-
 class ICA(ContainsMixin):
 
     """M/EEG signal decomposition using Independent Component Analysis (ICA)
@@ -1859,7 +1859,8 @@ def read_ica(fname):
     fid, tree, _ = fiff_open(fname)
 
     try:
-        info, meas = read_meas_info(fid, tree)
+        # we used to store bads that weren't part of the info...
+        info, meas = read_meas_info(fid, tree, clean_bads=True)
     except ValueError:
         logger.info('Could not find the measurement info. \n'
                     'Functionality requiring the info won\'t be'


Test patch: