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

Issue:
BUG: pyvista deprecation warnings on current master
In #6575 I'm getting CI failures due to DeprecationWarnings related to PyVista, even after a rebase to current master and a force-push.
cc @GuillaumeFavelier 



Discussion:

Resolving patch:
diff --git a/mne/viz/backends/_pyvista.py b/mne/viz/backends/_pyvista.py
--- a/mne/viz/backends/_pyvista.py
+++ b/mne/viz/backends/_pyvista.py
@@ -11,13 +11,15 @@
 #
 # License: Simplified BSD
 
-import vtk
-import pyvista
-import warnings
 import numpy as np
+import warnings
+import vtk
 from .base_renderer import _BaseRenderer
 from ._utils import _get_colormap_from_array
 from ...utils import copy_base_doc_to_subclass_doc
+with warnings.catch_warnings():
+    warnings.filterwarnings("ignore", category=DeprecationWarning)
+    import pyvista
 
 
 class _Projection(object):


Test patch:
diff --git a/mne/viz/backends/tests/_utils.py b/mne/viz/backends/tests/_utils.py
--- a/mne/viz/backends/tests/_utils.py
+++ b/mne/viz/backends/tests/_utils.py
@@ -12,7 +12,9 @@
 def has_pyvista():
     """Check that pyvista is installed."""
     try:
-        import pyvista  # noqa: F401
+        with warnings.catch_warnings():
+            warnings.filterwarnings("ignore", category=DeprecationWarning)
+            import pyvista  # noqa: F401
         return True
     except ImportError:
         return False
Repository: mne-tools/mne-python

Issue:
tight_layout vertically compresses PSD plots
The extension of spatial colors from Raw to Epochs in #6451 has revealed a bug with the use of tight_layout.

https://github.com/mne-tools/mne-python/blob/cc836c2635b7a720ec6c60074a1997fe52d7ca2f/mne/viz/utils.py#L3064-L3066

Tight layout often (but not always!) vertically compresses the PSD plots when spatial_colors are used with Epochs. I thought at first this had something to do with the changes in #6451, but it turns out to have always been there. It just wasn't apparent before because it only happens when the channels are relatively flat and uniform - which can sometimes happen with the multitaper psd method used by method Epochs.plot_psd, and also because because tight_layout was never used in the average=True case, which up until #6451 was the only option available for Epochs.plot_psd.

You can test that this is the case by taking the latest stable release and producing a vertically compressed PSD plot even for Raw.plot_psd, but setting the n_fft variable to an extremely low value - thus simulating the very broad window used in Epochs with multitaper fft, and the resultant flat, uniform PSDs.

What would then be the sensible thing to do here? Is simply removing the call to tight_layout an option? It was after all never used for average=True, and that seems fine?


Discussion:

Resolving patch:
diff --git a/mne/viz/utils.py b/mne/viz/utils.py
--- a/mne/viz/utils.py
+++ b/mne/viz/utils.py
@@ -3062,7 +3062,8 @@ def _plot_psd(inst, fig, freqs, psd_list, picks_list, titles_list,
             ax.set_ylabel(ylabel)
             ax.set_title(title)
     if make_label:
-        tight_layout(pad=0.1, h_pad=0.1, w_pad=0.1, fig=fig)
+        fig.subplots_adjust(left=.1, bottom=.1, right=.9, top=.9, wspace=0.3,
+                            hspace=0.5)
     return fig
 
 


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

Issue:
Epoch series numbers missing
Previously, Epochs.plot/ICA.plot_sources(Epoch) displayed the epoch series number underneath, though now it does not. A lab member reports that it started after we pulled #6617, so it may be related to that somehow.




Discussion:

Resolving patch:
diff --git a/mne/viz/epochs.py b/mne/viz/epochs.py
--- a/mne/viz/epochs.py
+++ b/mne/viz/epochs.py
@@ -961,7 +961,8 @@ def _prepare_mne_browse_epochs(params, projs, n_channels, n_epochs, scalings,
     from matplotlib.colors import colorConverter
     epochs = params['epochs']
     info = info or epochs.info
-    orig_epoch_times, events, name = epochs.times, epochs.events, epochs._name
+    orig_epoch_times, epochs_events = epochs.times, epochs.events
+    name = epochs._name
     del epochs
 
     # Reorganize channels
@@ -990,7 +991,7 @@ def _prepare_mne_browse_epochs(params, projs, n_channels, n_epochs, scalings,
 
     # set up plotting
     size = get_config('MNE_BROWSE_RAW_SIZE')
-    n_epochs = min(n_epochs, len(events))
+    n_epochs = min(n_epochs, len(epochs_events))
     duration = len(orig_epoch_times) * n_epochs
     n_channels = min(n_channels, len(picks))
     if size is not None:
@@ -1043,7 +1044,7 @@ def _prepare_mne_browse_epochs(params, projs, n_channels, n_epochs, scalings,
     type_colors = [colorConverter.to_rgba(color[c]) for c in types]
     colors = list()
     for color_idx in range(len(type_colors)):
-        colors.append([type_colors[color_idx]] * len(events))
+        colors.append([type_colors[color_idx]] * len(epochs_events))
     lines = list()
     n_times = len(orig_epoch_times)
 
@@ -1063,7 +1064,7 @@ def _prepare_mne_browse_epochs(params, projs, n_channels, n_epochs, scalings,
     offset = ylim[0] / n_channels
     offsets = np.arange(n_channels) * offset + (offset / 2.)
 
-    times = np.arange(len(orig_epoch_times) * len(events))
+    times = np.arange(len(orig_epoch_times) * len(epochs_events))
     epoch_times = np.arange(0, len(times), n_times)
 
     ax.set_yticks(offsets)


Test patch:
diff --git a/mne/viz/tests/test_epochs.py b/mne/viz/tests/test_epochs.py
--- a/mne/viz/tests/test_epochs.py
+++ b/mne/viz/tests/test_epochs.py
@@ -55,7 +55,9 @@ def test_plot_epochs_basic(capsys):
     epochs = _get_epochs().load_data()
     assert len(epochs.events) == 1
     epochs.info['lowpass'] = 10.  # allow heavy decim during plotting
-    epochs.plot(scalings=None, title='Epochs')
+    fig = epochs.plot(scalings=None, title='Epochs')
+    ticks = [x.get_text() for x in fig.axes[0].get_xticklabels()]
+    assert ticks == ['1']
     plt.close('all')
     # covariance / whitening
     cov = read_cov(cov_fname)
Repository: mne-tools/mne-python

Issue:
BUG: dipy website change broke intersphinx
CircleCI now fails to load the dipy `objects.inv` with this error:
```
intersphinx inventory 'http://nipy.org/dipy/objects.inv' not fetchable due to <class 'requests.exceptions.HTTPError'>: 400 Client Error: Bad Request for url: https://dipy.org/objects.inv
```
It appears that now anything within `nipy.org/dipy/*` redirects to `dipy.org/*`


Discussion:
This is a downer because it will kill all of our doc builds :(
```
$ git grep "dipy" | wc -l
      44
```
We can temporarily convert all the links to code blocks. It's easy to revert GH commits so I might just make a PR to work around this issue Monday.

Resolving patch:
diff --git a/doc/conf.py b/doc/conf.py
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -309,7 +309,7 @@
     'surfer': ('https://pysurfer.github.io/', None),
     'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
     'statsmodels': ('http://www.statsmodels.org/stable/', None),
-    'dipy': ('http://nipy.org/dipy', None),
+    'dipy': ('https://dipy.org/documentation/latest/', None),
     'mne_realtime': ('https://mne.tools/mne-realtime', None),
     'picard': ('https://pierreablin.github.io/picard/', None),
 }


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

Issue:
BUG: Report.save() does not use current working directory (as advertised)
As seen below, the current working directory is `$HOME/Desktop/report-tmp` and `report.save()` with no arguments saves to `$MNE_PYTHON_PACKAGE_ROOT/report.html`

```ipython
In [1]: import os                                                                                                                                
In [2]: os.getcwd()                                                                                                                              
Out[2]: '/home/drmccloy/Desktop/report-tmp'
In [3]: from mne.report import Report                                                                                                            
In [4]: from mne.datasets import sample                                                                                                          
In [5]: path = sample.data_path()                                                                                                                
In [6]: report = Report(verbose=True)                                                                                                            
Embedding : jquery.js
Embedding : jquery-ui.min.js
Embedding : bootstrap.min.js
Embedding : jquery-ui.min.css
Embedding : bootstrap.min.css
In [7]: report.save()                                                                                                                            
<ipython-input-7-27511b8eb600>:1: RuntimeWarning: `data_path` not provided. Using /opt/mne/python/mne instead
  report.save()
Report already exists at location /opt/mne/python/mne/report.html. Overwrite it (y/[n])? n
Out[7]: '/opt/mne/python/mne/report.html'
```

Also the `RuntimeWarning` is confusing (to a first-time Report user like me) because `data_path` is not one of the parameters of `Report` or `Report.save()`


Discussion:
That's here:

https://github.com/mne-tools/mne-python/blob/master/mne/report.py#L1558

And it's not what we say it will do (which is `os.getcwd()`). This is a bug, feel free to fix separately or as part of your PR.

Resolving patch:
diff --git a/mne/report.py b/mne/report.py
--- a/mne/report.py
+++ b/mne/report.py
@@ -1555,7 +1555,7 @@ def save(self, fname=None, open_browser=True, overwrite=False):
         """
         if fname is None:
             if not hasattr(self, 'data_path'):
-                self.data_path = op.dirname(__file__)
+                self.data_path = os.getcwd()
                 warn('`data_path` not provided. Using %s instead'
                      % self.data_path)
             fname = op.realpath(op.join(self.data_path, 'report.html'))


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

Issue:
ica.plot_properties: y-axis scale missing in variance plot
In mne 18.2., the plot that shows the variance captured by a component over segments (lower right) generated by ica.plot_properties lacks the tick marks (scale) for the y-axis. Could that be brought back? It helps to have an idea of the scale. Thanks!



Discussion:
indeed we should not have AU for y-label and scale.

PR welcome

There isn't even a scale:
https://mne.tools/stable/auto_tutorials/preprocessing/plot_artifacts_correction_ica.html#sphx-glr-auto-tutorials-preprocessing-plot-artifacts-correction-ica-py
@agramfort Last time this was discussed we decided variance should be AU, but eliminating the ticks and their values was mostly an aesthetic maneuver IIRC:
https://github.com/mne-tools/mne-python/pull/5748

BTW, I am not against bringing the y ticks back, I was actually not so happy to remove them, but I left it for the others to decide.
I just skimmed through the discussion in #5748 and actually no one wanted the y axis ticks and labels removed - it was a misunderstanding and apparently we forgot this because we were too busy with bikeshedding. I can do a PR unless @SophieHerbst wants to do it.
go for it @cbrnr

thx


Resolving patch:
diff --git a/mne/viz/ica.py b/mne/viz/ica.py
--- a/mne/viz/ica.py
+++ b/mne/viz/ica.py
@@ -183,8 +183,6 @@ def _plot_ica_properties(pick, ica, inst, psds_mean, freqs, n_trials,
     # compute percentage of dropped epochs
     var_percent = float(len(dropped_indices)) / float(len(epoch_var)) * 100.
 
-    var_ax.set_yticks([])
-
     # histogram & histogram
     _, counts, _ = hist_ax.hist(epoch_var, orientation="horizontal",
                                 color="k", alpha=.5)
@@ -206,7 +204,7 @@ def _plot_ica_properties(pick, ica, inst, psds_mean, freqs, n_trials,
     set_title_and_labels(image_ax, kind + ' image and ERP/ERF', [], kind)
 
     # erp
-    set_title_and_labels(erp_ax, [], 'Time (s)', 'AU\n')
+    set_title_and_labels(erp_ax, [], 'Time (s)', 'AU')
     erp_ax.spines["right"].set_color('k')
     erp_ax.set_xlim(epochs_src.times[[0, -1]])
     # remove half of yticks if more than 5
@@ -230,10 +228,8 @@ def _plot_ica_properties(pick, ica, inst, psds_mean, freqs, n_trials,
     image_ax.axhline(0, color='k', linewidth=.5)
 
     # epoch variance
-    var_ax_title = 'Dropped segments : %.2f %%' % var_percent
-    set_title_and_labels(var_ax, var_ax_title,
-                         kind + ' (index)',
-                         'Variance (AU)')
+    var_ax_title = 'Dropped segments: %.2f %%' % var_percent
+    set_title_and_labels(var_ax, var_ax_title, kind, 'Variance (AU)')
 
     hist_ax.set_ylabel("")
     hist_ax.set_yticks([])


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

Issue:
Can't read eeglab file: AttributeError
Hi,
I am a new mne-python user. when I am trying to import evoked eeglab data for topomap:
import mne
data=mne.read_epochs_eeglab('sub01_epochs_BEFORE_ICA_rej_wrong_extreme_S1_Con.set')

there occurs an error:  
AttributeError: 'Bunch' object has no attribute 'trials'
![1](https://user-images.githubusercontent.com/55588462/65331615-b44b2100-dbef-11e9-82ae-798ab86c67bb.jpg)

I don't know where the problem is. 
Many thanks for any comment. 



Discussion:
can you share the file with me so I can look at it?

>

Please see the attached file.
thank you very much!




------------------ 原始邮件 ------------------
发件人: "Alexandre Gramfort"<notifications@github.com>;
发送时间: 2019年9月20日(星期五) 晚上9:48
收件人: "mne-tools/mne-python"<mne-python@noreply.github.com>;
抄送: "蓝天·翔云"<723863343@qq.com>;"State change"<state_change@noreply.github.com>;
主题: Re: [mne-tools/mne-python] Can't read eeglab file: AttributeError(#6796)



can you share the file with me so I can look at it?
 
 >
 
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.


从QQ邮箱发来的超大附件

sub01_orthogonal_simon_epochs_BEFORE_ICA_rej_wrong_extreme_S1_Con.zip (89.66M, 2019年10月20日 21:45 到期)进入下载页面：http://mail.qq.com/cgi-bin/ftnExs_download?t=exs_ftn_download&k=1f316531cbe250c24a76401a16660717530255090607510848025206064b015e01504809035005155c035c0008070300565453553023354b105355006f09474c0d5e025e5e0759671658085e5e3950480a520d426f24707e2a63206e7925746717540f6e47145a56026e004944145055006e36006f255a564b4b0c41305b&code=e1e10f58
Attachments to emails to GitHub (which just make comments on the GitHub site) do not come through. Can you upload to DropBox or email @agramfort separately?
> Attachments to emails to GitHub (which just make comments on the GitHub site) do not come through. Can you upload to DropBox or email @agramfort separately?

Sorry. the file is too big. I have emailed @agramfort.
it's a problem with the file (although EEGLAB reads it fine)

you have one level too much of EEG structure.

I need to do:

eeg['EEG']['EEG']

rather than:

eeg['EEG']

how did you save this file?

>

it was saved by "pop_saveset()".
is it possible the using incompatible software? (matlab 7.9.0, eeglab v11.0.5.4b)?


Resolving patch:
diff --git a/mne/io/eeglab/eeglab.py b/mne/io/eeglab/eeglab.py
--- a/mne/io/eeglab/eeglab.py
+++ b/mne/io/eeglab/eeglab.py
@@ -45,7 +45,10 @@ def _check_load_mat(fname, uint16_codec):
             'mne-python developers for more information.')
     if 'EEG' not in eeg:
         raise ValueError('Could not find EEG array in the .set file.')
-    eeg = Bunch(**eeg['EEG'])
+    else:
+        eeg = eeg['EEG']
+    eeg = eeg.get('EEG', eeg)  # handle nested EEG structure
+    eeg = Bunch(**eeg)
     eeg.trials = int(eeg.trials)
     eeg.nbchan = int(eeg.nbchan)
     eeg.pnts = int(eeg.pnts)


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

Issue:
docstring head_to_mri
It should be MRI RAS not MNI:

https://github.com/mne-tools/mne-python/blob/master/mne/source_space.py#L1158


Discussion:

Resolving patch:
diff --git a/mne/source_space.py b/mne/source_space.py
--- a/mne/source_space.py
+++ b/mne/source_space.py
@@ -1144,7 +1144,7 @@ def head_to_mri(pos, subject, mri_head_t, subjects_dir=None,
     Returns
     -------
     coordinates : array, shape (n_pos, 3)
-        The MNI coordinates (in mm) of pos
+        The MRI RAS coordinates (in mm) of pos
 
     Notes
     -----


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

Issue:
BUG, VIZ: plot_filter too aggressive in rounding xticklabels
Notice 3 ticks all labelled `0.0` on the middle and bottom panels:

```
import os
import mne
sample_data_folder = mne.datasets.sample.data_path()
sample_data_raw_file = os.path.join(sample_data_folder, 'MEG', 'sample',
                                    'sample_audvis_raw.fif')
raw = mne.io.read_raw_fif(sample_data_raw_file)
raw.crop(0, 60).load_data()

filter_params = mne.filter.create_filter(raw.get_data(), raw.info['sfreq'],
                                         l_freq=0.2, h_freq=None)
mne.viz.plot_filter(filter_params, raw.info['sfreq'], flim=(0.01, 5))
```
![Figure_3](https://user-images.githubusercontent.com/1810515/65967161-07a24800-e416-11e9-9513-16a9bb5af9f7.png)



Discussion:

Resolving patch:
diff --git a/mne/viz/misc.py b/mne/viz/misc.py
--- a/mne/viz/misc.py
+++ b/mne/viz/misc.py
@@ -870,8 +870,6 @@ def plot_filter(h, sfreq, freq=None, gain=None, title=None, color='#1f77b4',
         if xticks is not None:
             ax.set(xticks=xticks)
             ax.set(xticklabels=xticklabels)
-        ax.xaxis.set_major_formatter(FormatStrFormatter('%0.1f'))
-        ax.xaxis.set_minor_formatter(NullFormatter())
         ax.set(xlim=flim, ylim=ylim, xlabel='Frequency (Hz)', ylabel=ylabel)
     adjust_axes([ax_time, ax_freq, ax_delay])
     tight_layout()
diff --git a/tutorials/discussions/plot_background_filtering.py b/tutorials/discussions/plot_background_filtering.py
--- a/tutorials/discussions/plot_background_filtering.py
+++ b/tutorials/discussions/plot_background_filtering.py
@@ -6,8 +6,8 @@
 Background information on filtering
 ===================================
 
-Here we give some background information on filtering in general,
-and how it is done in MNE-Python in particular.
+Here we give some background information on filtering in general, and
+how it is done in MNE-Python in particular.
 Recommended reading for practical applications of digital
 filter design can be found in Parks & Burrus (1987) [1]_ and
 Ifeachor & Jervis (2002) [2]_, and for filtering in an


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

Issue:
DOC: bad tutorial formatting
In this tutorial: https://mne.tools/dev/auto_tutorials/preprocessing/plot_45_projectors_background.html#computing-projectors

a section is getting rendered as python comments instead of an rST block.


Discussion:

Resolving patch:
diff --git a/tutorials/preprocessing/plot_45_projectors_background.py b/tutorials/preprocessing/plot_45_projectors_background.py
--- a/tutorials/preprocessing/plot_45_projectors_background.py
+++ b/tutorials/preprocessing/plot_45_projectors_background.py
@@ -308,7 +308,6 @@ def setup_3d_axes():
 # Computing projectors
 # ~~~~~~~~~~~~~~~~~~~~
 #
-
 # In MNE-Python, SSP vectors can be computed using general purpose functions
 # :func:`mne.compute_proj_raw`, :func:`mne.compute_proj_epochs`, and
 # :func:`mne.compute_proj_evoked`. The general assumption these functions make


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

Issue:
BUG?  Extended infomax ICA  
This looks like a bug to me, the documentation says that (through a backwards incompatible change) `if you want Extended Infomax, set method='infomax' and fit_params=dict(extended=True)`, however for `method='infomax'` [these lines](https://github.com/mne-tools/mne-python/blob/master/mne/preprocessing/ica.py#L359-L360) force `extended` to `False`.


Discussion:
And I think this would have been the case in 0.18 and 0.19 too.
That does look like a bug, can you make a bugfix? Then we can backport to 0.19. We're probably going to do a 0.19.1 early next week
I can do it. My flight is drastically delayed.
Go for it!

Resolving patch:
diff --git a/mne/preprocessing/ica.py b/mne/preprocessing/ica.py
--- a/mne/preprocessing/ica.py
+++ b/mne/preprocessing/ica.py
@@ -357,12 +357,10 @@ def __init__(self, n_components=None, max_pca_components=None,
             fit_params.update({k: v for k, v in update.items() if k
                                not in fit_params})
         elif method == 'infomax':
-            fit_params.update({'extended': False})
-        elif method == 'extended-infomax':
-            fit_params.update({'extended': True})
-            method = 'infomax'
-        if 'max_iter' not in fit_params:
-            fit_params['max_iter'] = max_iter
+            # extended=True is default in underlying function, but we want
+            # default False here unless user specified True:
+            fit_params.setdefault('extended', False)
+        fit_params.setdefault('max_iter', max_iter)
         self.max_iter = max_iter
         self.fit_params = fit_params
 


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

Issue:
BUG: Misalignement plotting TFR with linear y-axis
### Describe the bug
Plotting TFRs with linear y-axis, bins for the particular frequencies are not properly aligned with the y-axis.

#### Steps and/or code to reproduce
[This gist](https://gist.github.com/stfnrpplngr/2378c70e6285322f38d54fa04d1fc764) is an example to produce the erroneous plot. The center of the notch filter appears not at 50 Hz regarding the plot.

#### Expected results
50 Hz frequency bin is centered at the 50 Hz y-tick:
![Issue_freq_shift_notch_solved](https://user-images.githubusercontent.com/20129752/66406313-b97bde80-e9eb-11e9-9367-9953b2fc2044.png)
![issue_freq_shift_solved2](https://user-images.githubusercontent.com/20129752/66406325-bbde3880-e9eb-11e9-93c3-74d487e234c5.png)

#### Actual results
50 Hz frequency bin is not centered at the 50 Hz y-tick:
![Issue_freq_shift_notch](https://user-images.githubusercontent.com/20129752/66406447-e9c37d00-e9eb-11e9-887d-691a7bb422f5.png)
![Issue_freq_shift_notch_2](https://user-images.githubusercontent.com/20129752/66406445-e92ae680-e9eb-11e9-9dfd-f80cacd6f787.png)

#### Additional information
Platform:      Windows-10-10.0.16299-SP0
Python:        3.7.4 (default, Aug  9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)]
Executable:    C:\Continuum\Anaconda3\envs\general\python.exe
CPU:           Intel64 Family 6 Model 142 Stepping 10, GenuineIntel: 8 cores
Memory:        Unavailable (requires "psutil" package)
mne:           0.20.dev0
numpy:         1.16.5 {blas=mkl_rt, lapack=mkl_rt}
scipy:         1.3.1
matplotlib:    3.1.1 {backend=Qt5Agg}

sklearn:       0.21.3
numba:         Not found
nibabel:       Not found
cupy:          Not found
pandas:        0.25.1
dipy:          Not found
mayavi:        Not found
pyvista:       Not found
vtk:           Not found



Discussion:

Resolving patch:
diff --git a/mne/viz/utils.py b/mne/viz/utils.py
--- a/mne/viz/utils.py
+++ b/mne/viz/utils.py
@@ -2858,7 +2858,10 @@ def _plot_masked_image(ax, data, times, mask=None, yvals=None,
     else:
         # imshow for linear because the y ticks are nicer
         # and the masked areas look better
-        extent = [times[0], times[-1], yvals[0], yvals[-1] + 1]
+        dt = np.median(np.diff(times)) / 2. if len(times) > 1 else 0.1
+        dy = np.median(np.diff(yvals)) / 2. if len(yvals) > 1 else 0.5
+        extent = [times[0] - dt, times[-1] + dt,
+                  yvals[0] - dy, yvals[-1] + dy]
         im_args = dict(interpolation='nearest', origin='lower',
                        extent=extent, aspect='auto', vmin=vmin, vmax=vmax)
 
@@ -2874,8 +2877,9 @@ def _plot_masked_image(ax, data, times, mask=None, yvals=None,
             ax.contour(big_mask, colors=["k"], extent=extent,
                        linewidths=[.75], corner_mask=False,
                        antialiased=False, levels=[.5])
-        time_lims = times[[0, -1]]
-        ylim = yvals[0], yvals[-1] + 1
+        time_lims = [extent[0], extent[1]]
+        if ylim is None:
+            ylim = [extent[2], extent[3]]
 
     ax.set_xlim(time_lims[0], time_lims[-1])
     ax.set_ylim(ylim)


Test patch: