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

Issue:
use bibtex in hf_sef.py
convert references in `mne/datasets/hf_sef/hf_sef.py` to use footcite / footbibliography



Discussion:
I'll work on this

Resolving patch:
diff --git a/mne/datasets/hf_sef/hf_sef.py b/mne/datasets/hf_sef/hf_sef.py
--- a/mne/datasets/hf_sef/hf_sef.py
+++ b/mne/datasets/hf_sef/hf_sef.py
@@ -16,7 +16,8 @@ def data_path(dataset='evoked', path=None, force_update=False,
               update_path=True, verbose=None):
     u"""Get path to local copy of the high frequency SEF dataset.
 
-    Gets a local copy of the high frequency SEF MEG dataset [1]_.
+    Gets a local copy of the high frequency SEF MEG dataset
+    :footcite:`NurminenEtAl2017`.
 
     Parameters
     ----------
@@ -44,8 +45,7 @@ def data_path(dataset='evoked', path=None, force_update=False,
 
     References
     ----------
-    .. [1] Nurminen, J., Paananen, H., Mäkelä, J. (2017): High frequency
-           somatosensory MEG dataset. https://doi.org/10.5281/zenodo.889234
+    .. footbibliography::
     """
     key = 'MNE_DATASETS_HF_SEF_PATH'
     name = 'HF_SEF'
diff --git a/mne/datasets/limo/limo.py b/mne/datasets/limo/limo.py
--- a/mne/datasets/limo/limo.py
+++ b/mne/datasets/limo/limo.py
@@ -48,9 +48,9 @@ def data_path(subject, path=None, force_update=False, update_path=None,
               verbose=None):
     """Get path to local copy of LIMO dataset URL.
 
-    This is a low-level function useful for getting a local copy of the remote
-    LIMO dataset :footcite: `Rousselet2016`. The complete dataset is available
-    at datashare.is.ed.ac.uk/.
+    This is a low-level function useful for getting a local copy of the
+    remote LIMO dataset :footcite:`Rousselet2016`. The complete dataset is
+    available at datashare.is.ed.ac.uk/.
 
     Parameters
     ----------


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

Issue:
use bibtex in plot_brainstorm_phantom_elekta.py
convert references in `tutorials/sample-datasets/plot_brainstorm_phantom_elekta.py` to use footcite / footbibliography



Discussion:

Resolving patch:
diff --git a/tutorials/sample-datasets/plot_brainstorm_phantom_elekta.py b/tutorials/sample-datasets/plot_brainstorm_phantom_elekta.py
--- a/tutorials/sample-datasets/plot_brainstorm_phantom_elekta.py
+++ b/tutorials/sample-datasets/plot_brainstorm_phantom_elekta.py
@@ -7,16 +7,13 @@
 ==========================================
 
 Here we compute the evoked from raw for the Brainstorm Elekta phantom
-tutorial dataset. For comparison, see [1]_ and:
+tutorial dataset. For comparison, see :footcite:`TadelEtAl2011` and:
 
     https://neuroimage.usc.edu/brainstorm/Tutorials/PhantomElekta
 
 References
 ----------
-.. [1] Tadel F, Baillet S, Mosher JC, Pantazis D, Leahy RM.
-       Brainstorm: A User-Friendly Application for MEG/EEG Analysis.
-       Computational Intelligence and Neuroscience, vol. 2011, Article ID
-       879716, 13 pages, 2011. doi:10.1155/2011/879716
+.. footbibliography::
 """
 # sphinx_gallery_thumbnail_number = 9
 


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

Issue:
use bibtex in otp.py
convert references in `mne/preprocessing/otp.py` to use footcite / footbibliography



Discussion:

Resolving patch:
diff --git a/mne/preprocessing/otp.py b/mne/preprocessing/otp.py
--- a/mne/preprocessing/otp.py
+++ b/mne/preprocessing/otp.py
@@ -54,7 +54,8 @@ def oversampled_temporal_projection(raw, duration=10., picks=None,
     slower than realtime for conventional M/EEG datasets. It uses a
     leave-one-out procedure with parallel temporal projection to remove
     individual sensor noise under the assumption that sampled fields
-    (e.g., MEG and EEG) are oversampled by the sensor array [1]_.
+    (e.g., MEG and EEG) are oversampled by the sensor array
+    :footcite:`LarsonTaulu2018`.
 
     OTP can improve sensor noise levels (especially under visual
     inspection) and repair some bad channels. This noise reduction is known
@@ -72,9 +73,7 @@ def oversampled_temporal_projection(raw, duration=10., picks=None,
 
     References
     ----------
-    .. [1] Larson E, Taulu S (2017). Reducing Sensor Noise in MEG and EEG
-           Recordings Using Oversampled Temporal Projection.
-           IEEE Transactions on Biomedical Engineering.
+    .. footbibliography::
     """
     logger.info('Processing MEG data using oversampled temporal projection')
     picks = _picks_to_idx(raw.info, picks, exclude=())


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

Issue:
use read_info in covariance example
`examples/io/plot_read_noise_covariance_matrix.py` should use `mne.io.read_info` instead of reading the whole evoked object, as only the info is needed.

Other changes to that file:

- remove `print(__doc__)`
- title should start with "How to"


Discussion:

Resolving patch:
diff --git a/examples/io/plot_read_noise_covariance_matrix.py b/examples/io/plot_read_noise_covariance_matrix.py
--- a/examples/io/plot_read_noise_covariance_matrix.py
+++ b/examples/io/plot_read_noise_covariance_matrix.py
@@ -3,7 +3,7 @@
 Reading/Writing a noise covariance matrix
 =========================================
 
-Plot a noise covariance matrix.
+How to plot a noise covariance matrix.
 """
 # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
 #
@@ -13,17 +13,15 @@
 import mne
 from mne.datasets import sample
 
-print(__doc__)
-
 data_path = sample.data_path()
 fname_cov = op.join(data_path, 'MEG', 'sample', 'sample_audvis-cov.fif')
 fname_evo = op.join(data_path, 'MEG', 'sample', 'sample_audvis-ave.fif')
 
 cov = mne.read_cov(fname_cov)
 print(cov)
-evoked = mne.read_evokeds(fname_evo)[0]
+ev_info = mne.io.read_info(fname_evo)
 
 ###############################################################################
-# Show covariance
+# Plot covariance
 
-cov.plot(evoked.info, exclude='bads', show_svd=False)
+cov.plot(ev_info, exclude='bads', show_svd=False)


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

Issue:
split code block in examples/preprocessing/plot_virtual_evoked
right now, because all plots come from a single code block, they are plotted at the top of the example in a group of 4 (and consequently the plots are really small).  By splitting the 4 plotting calls into different code blocks, they will plot larger / be easier to see & compare, without increasing run time of the example.  Code blocks can be split with a line of 79 `#` marks (adding a bit of explanatory text too is usually a good idea)


Discussion:
I would like to take care of this one

Resolving patch:
diff --git a/examples/preprocessing/plot_virtual_evoked.py b/examples/preprocessing/plot_virtual_evoked.py
--- a/examples/preprocessing/plot_virtual_evoked.py
+++ b/examples/preprocessing/plot_virtual_evoked.py
@@ -26,14 +26,30 @@
 fname = data_path + '/MEG/sample/sample_audvis-ave.fif'
 evoked = mne.read_evokeds(fname, condition='Left Auditory', baseline=(None, 0))
 
-# go from grad + mag to mag
+###############################################################################
+# First, let's call remap gradiometers to magnometers, and plot
+# the original and remapped topomaps of the magnetometers.
+
+# go from grad + mag to mag and plot original mag
 virt_evoked = evoked.as_type('mag')
 evoked.plot_topomap(ch_type='mag', title='mag (original)', time_unit='s')
+
+###############################################################################
+
+# plot interpolated grad + mag
 virt_evoked.plot_topomap(ch_type='mag', time_unit='s',
                          title='mag (interpolated from mag + grad)')
 
-# go from grad + mag to grad
+###############################################################################
+# Now, we remap magnometers to gradiometers, and plot
+# the original and remapped topomaps of the gradiometers
+
+# go from grad + mag to grad and plot original grad
 virt_evoked = evoked.as_type('grad')
 evoked.plot_topomap(ch_type='grad', title='grad (original)', time_unit='s')
+
+###############################################################################
+
+# plot interpolated grad + mag
 virt_evoked.plot_topomap(ch_type='grad', time_unit='s',
                          title='grad (interpolated from mag + grad)')


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

Issue:
use bibtex in plot_channel_epochs_image.py
convert references in `examples/visualization/plot_channel_epochs_image.py` to use footcite / footbibliography



Discussion:
Hi, I'm going to work on this

Resolving patch:
diff --git a/examples/visualization/plot_channel_epochs_image.py b/examples/visualization/plot_channel_epochs_image.py
--- a/examples/visualization/plot_channel_epochs_image.py
+++ b/examples/visualization/plot_channel_epochs_image.py
@@ -10,7 +10,7 @@
 that does not show any evoked field.
 
 It is also demonstrated how to reorder the epochs using a 1D spectral
-embedding as described in [1]_.
+embedding as described in :footcite:`GramfortEtAl2010`.
 """
 # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
 #
@@ -75,7 +75,4 @@ def order_func(times, data):
 ###############################################################################
 # References
 # ----------
-# .. [1] Graph-based variability estimation in single-trial event-related
-#        neural responses. A. Gramfort, R. Keriven, M. Clerc, 2010,
-#        Biomedical Engineering, IEEE Trans. on, vol. 57 (5), 1051-1061
-#        https://ieeexplore.ieee.org/document/5406156
+# .. footbibliography::


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

Issue:
Add "copy" button to code blocks
Code blocks, at least in the tutorials, should come with a "copy" button, allowing users to conveniently copy code snippets to the clipboard.

Not sure if this is something that needs to be addressed upstream?


Discussion:
I recently added sphinx-copybutton to mne-bids and several other repos, and it does the job very well: https://github.com/executablebooks/sphinx-copybutton

Resolving patch:
diff --git a/doc/conf.py b/doc/conf.py
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -89,6 +89,7 @@
     'mne_substitutions',
     'sphinx_bootstrap_divs',
     'sphinxcontrib.bibtex',
+    'sphinx_copybutton',
 ]
 
 # Add any paths that contain templates here, relative to this directory.


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

Issue:
User confused by using code snippets from TFR tutorial
See https://mne.discourse.group/t/tfr-morlet-temporal-resolution/2785

The user simply copied the code block with `decim=3` and was surprised the data got decimated. I think the tutorial should be more explicit about this, WDYT?


Discussion:
yes, in general we should always call out anything we do in the tutorials (for sake of build efficiency) that you wouldn't normally do locally.
Working on this! 

Resolving patch:
diff --git a/tutorials/time-freq/plot_sensors_time_frequency.py b/tutorials/time-freq/plot_sensors_time_frequency.py
--- a/tutorials/time-freq/plot_sensors_time_frequency.py
+++ b/tutorials/time-freq/plot_sensors_time_frequency.py
@@ -136,7 +136,13 @@
 # To this we'll use the function :func:`mne.time_frequency.tfr_morlet`
 # but you can also use :func:`mne.time_frequency.tfr_multitaper`
 # or :func:`mne.time_frequency.tfr_stockwell`.
-
+#
+# .. note::
+#       The ``decim`` parameter reduces the sampling rate of the time-frequency
+#       decomposition by the defined factor. This is usually done to reduce
+#       memory usage. For more information refer to the documentation of
+#       :func:`mne.time_frequency.tfr_morlet`.
+#
 # define frequencies of interest (log-spaced)
 freqs = np.logspace(*np.log10([6, 35]), num=8)
 n_cycles = freqs / 2.  # different number of cycle per frequency


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

Issue:
clean up XDAWN example
in `examples/preprocessing/plot_xdawn_denoising.py` the references are printed at the top; move them to the bottom like they are in most other examples/tutorials.

While you're in there, read through the example and make sure you understand it; improve the wording/explanation of any parts that are awkward or unclear. How-to examples should be fairly short, but if adding a little something (a few extra sentences, one more plot, etc) would make it more informative or clear, add it.


Discussion:
I'm on this!

Resolving patch:
diff --git a/examples/preprocessing/plot_xdawn_denoising.py b/examples/preprocessing/plot_xdawn_denoising.py
--- a/examples/preprocessing/plot_xdawn_denoising.py
+++ b/examples/preprocessing/plot_xdawn_denoising.py
@@ -7,24 +7,13 @@
 space and then projected back in the sensor space using only the first two
 XDAWN components. The process is similar to an ICA, but is
 supervised in order to maximize the signal to signal + noise ratio of the
-evoked response.
+evoked response :footcite:`RivetEtAl2009, RivetEtAl2011`.
 
 .. warning:: As this denoising method exploits the known events to
              maximize SNR of the contrast between conditions it can lead
              to overfitting. To avoid a statistical analysis problem you
              should split epochs used in fit with the ones used in
              apply method.
-
-References
-----------
-[1] Rivet, B., Souloumiac, A., Attina, V., & Gibert, G. (2009). xDAWN
-algorithm to enhance evoked potentials: application to brain-computer
-interface. Biomedical Engineering, IEEE Transactions on, 56(8), 2035-2043.
-
-[2] Rivet, B., Cecotti, H., Souloumiac, A., Maby, E., & Mattout, J. (2011,
-August). Theoretical analysis of xDAWN algorithm: application to an
-efficient sensor selection in a P300 BCI. In Signal Processing Conference,
-2011 19th European (pp. 1382-1386). IEEE.
 """
 
 # Authors: Alexandre Barachant <alexandre.barachant@gmail.com>
@@ -85,3 +74,8 @@
 
 # Plot image epoch after Xdawn
 plot_epochs_image(epochs_denoised['vis_r'], picks=[230], vmin=-500, vmax=500)
+
+###############################################################################
+# References
+# ----------
+# .. footbibliography::


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

Issue:
use bibtex in temazepam.py
convert references in `mne/datasets/sleep_physionet/temazepam.py` to use footcite / footbibliography



Discussion:
I'll work on this one!:)

Resolving patch:
diff --git a/mne/datasets/sleep_physionet/temazepam.py b/mne/datasets/sleep_physionet/temazepam.py
--- a/mne/datasets/sleep_physionet/temazepam.py
+++ b/mne/datasets/sleep_physionet/temazepam.py
@@ -21,12 +21,13 @@ def fetch_data(subjects, *, path=None, force_update=False,
     """Get paths to local copies of PhysioNet Polysomnography dataset files.
 
     This will fetch data from the publicly available subjects from PhysioNet's
-    study of Temazepam effects on sleep [1]_. This corresponds to
-    a set of 22 subjects. Subjects had mild difficulty falling asleep
-    but were otherwise healthy.
+    study of Temazepam effects on sleep :footcite:`KempEtAl2000`. This
+    corresponds to a set of 22 subjects. Subjects had mild difficulty falling
+    asleep but were otherwise healthy.
 
     See more details in the `physionet website
-    <https://physionet.org/physiobank/database/sleep-edfx/>`_.
+    <https://physionet.org/physiobank/database/sleep-edfx/>`_
+    :footcite:`GoldbergerEtAl2000`.
 
     Parameters
     ----------
@@ -68,14 +69,7 @@ def fetch_data(subjects, *, path=None, force_update=False,
 
     References
     ----------
-    .. [1] B Kemp, AH Zwinderman, B Tuk, HAC Kamphuisen, JJL Oberyé. Analysis
-           of a sleep-dependent neuronal feedback loop: the slow-wave
-           microcontinuity of the EEG. IEEE-BME 47(9):1185-1194 (2000).
-    .. [2] Goldberger AL, Amaral LAN, Glass L, Hausdorff JM, Ivanov PCh,
-           Mark RG, Mietus JE, Moody GB, Peng C-K, Stanley HE. (2000)
-           PhysioBank, PhysioToolkit, and PhysioNet: Components of a New
-           Research Resource for Complex Physiologic Signals.
-           Circulation 101(23):e215-e220
+    .. footbibliography::
     """
     records = np.loadtxt(TEMAZEPAM_SLEEP_RECORDS,
                          skiprows=1,


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

Issue:
DOC: use footcite in mne/datasets/sleep_physionet/age.py
#### Reference issue
Fixes #9105.


#### What does this implement/fix?
Convert references in mne/datasets/sleep_physionet/age.py to use footcite / footbibliography



Discussion:

Resolving patch:
diff --git a/mne/datasets/sleep_physionet/age.py b/mne/datasets/sleep_physionet/age.py
--- a/mne/datasets/sleep_physionet/age.py
+++ b/mne/datasets/sleep_physionet/age.py
@@ -22,7 +22,8 @@ def fetch_data(subjects, recording=(1, 2), path=None, force_update=False,
     """Get paths to local copies of PhysioNet Polysomnography dataset files.
 
     This will fetch data from the publicly available subjects from PhysioNet's
-    study of age effects on sleep in healthy subjects [1]_[2]_. This
+    study of age effects on sleep in healthy subjects
+    :footcite:`MourtazaevEtAl1995,GoldbergerEtAl2000`. This
     corresponds to a subset of 153 recordings from 37 males and 41 females that
     were 25-101 years old at the time of the recordings. There are two night
     recordings per subject except for subjects 13, 36 and 52 which have one
@@ -81,14 +82,7 @@ def fetch_data(subjects, recording=(1, 2), path=None, force_update=False,
 
     References
     ----------
-    .. [1] MS Mourtazaev, B Kemp, AH Zwinderman, HAC Kamphuisen. Age and gender
-           affect different characteristics of slow waves in the sleep EEG.
-           Sleep 18(7):557–564 (1995).
-    .. [2] Goldberger AL, Amaral LAN, Glass L, Hausdorff JM, Ivanov PCh,
-           Mark RG, Mietus JE, Moody GB, Peng C-K, Stanley HE. (2000)
-           PhysioBank, PhysioToolkit, and PhysioNet: Components of a New
-           Research Resource for Complex Physiologic Signals.
-           Circulation 101(23):e215-e220
+    .. footbibliography::
     """  # noqa: E501
     records = np.loadtxt(AGE_SLEEP_RECORDS,
                          skiprows=1,


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

Issue:
epochs.plot_image(evoked=False) doesn't show time in seconds
`epochs.plot_image(evoked=False)` doesn't show time in seconds on the x-axis but samples. If `evoked=True` (default), the x-axis of the evoked response is used, which is in seconds.


Discussion:
Apparently, the x-axis shows time in milliseconds (and not samples).
it's consistent with evoked.plot then no?
The x-axis scaling depends on the `evoked` argument though. If `evoked=True`, it is in seconds, but if `evoked=False` it is in milliseconds. I think it is more important to be consistent within this function than to another function.
ok fair enough. Seems like a good task for the sprint

>

I can do it!

Resolving patch:
diff --git a/mne/viz/epochs.py b/mne/viz/epochs.py
--- a/mne/viz/epochs.py
+++ b/mne/viz/epochs.py
@@ -513,7 +513,7 @@ def _plot_epochs_image(image, style_axes=True, epochs=None, picks=None,
     # draw the image
     cmap = _setup_cmap(cmap, norm=norm)
     n_epochs = len(image)
-    extent = [1e3 * tmin, 1e3 * tmax, 0, n_epochs]
+    extent = [tmin, tmax, 0, n_epochs]
     im = ax_im.imshow(image, vmin=vmin, vmax=vmax, cmap=cmap[0], aspect='auto',
                       origin='lower', interpolation='nearest', extent=extent)
 
@@ -521,14 +521,16 @@ def _plot_epochs_image(image, style_axes=True, epochs=None, picks=None,
     if style_axes:
         ax_im.set_title(title)
         ax_im.set_ylabel('Epochs')
+        if not evoked:
+            ax_im.set_xlabel('Time (s)')
         ax_im.axis('auto')
         ax_im.axis('tight')
         ax_im.axvline(0, color='k', linewidth=1, linestyle='--')
 
     if overlay_times is not None:
-        ax_im.plot(1e3 * overlay_times, 0.5 + np.arange(n_epochs), 'k',
+        ax_im.plot(overlay_times, 0.5 + np.arange(n_epochs), 'k',
                    linewidth=2)
-        ax_im.set_xlim(1e3 * tmin, 1e3 * tmax)
+        ax_im.set_xlim(tmin, tmax)
 
     # draw the evoked
     if evoked:


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

Issue:
set_bipolar_reference is not present in the doc or any example
we should add

https://mne.tools/stable/generated/mne.set_bipolar_reference.html

to the some example and documentation.


Discussion:
some options are:

1. add it in [this section](https://mne.tools/dev/auto_tutorials/preprocessing/plot_55_setting_eeg_reference.html#setting-or-changing-the-reference-channel) or in a new section right after it.  
2. make a short how-to example that just illustrates bipolar referencing
3. both 1 and 2
a good sprint TODO I think

>

Working on this!

Resolving patch:
diff --git a/tutorials/preprocessing/plot_55_setting_eeg_reference.py b/tutorials/preprocessing/plot_55_setting_eeg_reference.py
--- a/tutorials/preprocessing/plot_55_setting_eeg_reference.py
+++ b/tutorials/preprocessing/plot_55_setting_eeg_reference.py
@@ -76,6 +76,9 @@
 # use average of mastoid channels as reference
 # raw.set_eeg_reference(ref_channels=['M1', 'M2'])
 
+# use a bipolar reference (contralateral)
+# raw.set_bipolar_reference(anode='[F3'], cathode=['F4'])
+
 ###############################################################################
 # If a scalp electrode was used as reference but was not saved alongside the
 # raw data (reference channels often aren't), you may wish to add it back to
@@ -188,6 +191,25 @@
     fig.subplots_adjust(top=0.9)
     fig.suptitle('{} reference'.format(title), size='xx-large', weight='bold')
 
+###############################################################################
+# Using a bipolar reference
+# ^^^^^^^^^^^^^^^^^^^^^^^^^
+#
+# To create a bipolar reference, you can use :meth:`~mne.set_bipolar_reference`
+# along with the respective channel names for ``anode`` and ``cathode`` which
+# creates a new virtual channel that takes the difference between two
+# specified channels (anode and cathode) and drops the original channels by
+# default. The new virtual channel will be annotated with the channel info of
+# the anode with location set to ``(0, 0, 0)`` and coil type set to
+# ``EEG_BIPOLAR`` by default. Here we use a contralateral/transverse bipolar
+# reference between channels ``EEG 054`` and ``EEG 055`` as described in
+# :footcite:`YaoEtAl2019` which creates a new virtual channel
+# named ``EEG 054-EEG 055``.
+
+raw_bip_ref = mne.set_bipolar_reference(raw, anode=['EEG 054'],
+                                        cathode=['EEG 055'])
+raw_bip_ref.plot()
+
 ###############################################################################
 # EEG reference and source modeling
 # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


Test patch: