Skip to content

Commit e4ed5fd

Browse files
larsoneragramfort
authored andcommitted
MRG: No warning in example (mne-tools#5742)
* FIX: No warning in example * FIX: Links
1 parent 7ddeded commit e4ed5fd

7 files changed

Lines changed: 53 additions & 55 deletions

File tree

doc/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,8 @@ def reset_warnings(gallery_conf, fname):
339339
warnings.filterwarnings(
340340
'always', '.*converting a masked element to nan.*') # matplotlib?
341341
# allow these warnings, but don't show them
342+
warnings.filterwarnings(
343+
'ignore', '.*OpenSSL\\.rand is deprecated.*')
342344
warnings.filterwarnings('ignore', '.*is currently using agg.*')
343345
warnings.filterwarnings( # SciPy-related warning (maybe 1.2.0 will fix it)
344346
'ignore', '.*the matrix subclass is not the recommended.*')

doc/tutorials/philosophy.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ One of the first things you might be wondering about is how to get your
99
data into mne. Assuming that you have unprocessed data, you will probably
1010
be happy with at least one of these readers:
1111

12-
* :func:`read_raw_fif <mne.io.read_raw_fif>`
13-
* :func:`read_raw_kit <mne.io.read_raw_kit>`
14-
* :func:`read_raw_bti <mne.io.read_raw_bti>`
15-
* :func:`read_raw_ctf <mne.io.read_raw_ctf>`
16-
* :func:`read_raw_brainvision <mne.io.read_raw_brainvision>`
17-
* :func:`read_raw_cnt <mne.io.read_raw_cnt>`
18-
* :func:`read_raw_edf <mne.io.read_raw_edf>`
19-
* :func:`read_raw_eeglab <mne.io.read_raw_eeglab>`
20-
* :func:`read_raw_egi <mne.io.read_raw_egi>`
21-
* :func:`read_raw_nicolet <mne.io.read_raw_nicolet>`
12+
* :func:`~mne.io.read_raw_fif`
13+
* :func:`~mne.io.read_raw_kit`
14+
* :func:`~mne.io.read_raw_bti`
15+
* :func:`~mne.io.read_raw_ctf`
16+
* :func:`~mne.io.read_raw_brainvision`
17+
* :func:`~mne.io.read_raw_cnt`
18+
* :func:`~mne.io.read_raw_edf`
19+
* :func:`~mne.io.read_raw_eeglab`
20+
* :func:`~mne.io.read_raw_egi`
21+
* :func:`~mne.io.read_raw_nicolet`
2222

2323
They all have in common to return an :class:`mne.io.Raw`-like object.
2424
See :ref:`ch_convert`.
@@ -87,7 +87,7 @@ Besides ``.ch_names`` another important attribute is ``.info``. It contains
8787
the channel information and some details about the processing history.
8888
This is especially relevant if your data cannot be read using the io
8989
functions listed above. You then need to learn how to create an info.
90-
See :ref:`tut_info_objects`.
90+
See :ref:`sphx_glr_auto_tutorials_plot_info.py`.
9191

9292
4. MNE is modular
9393
-----------------

tutorials/plot_creating_data_structures.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
###############################################################################
1616
# ------------------------------------------------------
17-
# Creating :class:`Info <mne.Info>` objects
17+
# Creating :class:`~mne.Info` objects
1818
# ------------------------------------------------------
1919
#
20-
# .. note:: for full documentation on the `Info` object, see
21-
# :ref:`tut_info_objects`. See also
20+
# .. note:: for full documentation on the :class:`~mne.Info` object, see
21+
# :ref:`sphx_glr_auto_tutorials_plot_info.py`. See also
2222
# :ref:`sphx_glr_auto_examples_io_plot_objects_from_arrays.py`.
2323
#
2424
# Normally, :class:`mne.Info` objects are created by the various
@@ -73,9 +73,9 @@
7373
# - The `ch_names` field should be consistent with the `name` field
7474
# of the channel information contained in `chs`.
7575
#
76-
# ---------------------------------------------
77-
# Creating :class:`Raw <mne.io.Raw>` objects
78-
# ---------------------------------------------
76+
# -------------------------------------
77+
# Creating :class:`~mne.io.Raw` objects
78+
# -------------------------------------
7979
#
8080
# To create a :class:`mne.io.Raw` object from scratch, you can use the
8181
# :class:`mne.io.RawArray` class, which implements raw data that is backed by a
@@ -105,9 +105,9 @@
105105
print(custom_raw)
106106

107107
###############################################################################
108-
# ---------------------------------------------
109-
# Creating :class:`Epochs <mne.Epochs>` objects
110-
# ---------------------------------------------
108+
# -------------------------------------
109+
# Creating :class:`~mne.Epochs` objects
110+
# -------------------------------------
111111
#
112112
# To create an :class:`mne.Epochs` object from scratch, you can use the
113113
# :class:`mne.EpochsArray` class, which uses a numpy array directly without
@@ -168,9 +168,9 @@
168168
_ = custom_epochs['smiling'].average().plot(time_unit='s')
169169

170170
###############################################################################
171-
# ---------------------------------------------
172-
# Creating :class:`Evoked <mne.Evoked>` Objects
173-
# ---------------------------------------------
171+
# -------------------------------------
172+
# Creating :class:`~mne.Evoked` Objects
173+
# -------------------------------------
174174
# If you already have data that is collapsed across trials, you may also
175175
# directly create an evoked array. Its constructor accepts an array of
176176
# `shape(n_chans, n_times)` in addition to some bookkeeping parameters.

tutorials/plot_epoching_and_averaging.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
###############################################################################
1313
# In MNE, `epochs` refers to a collection of `single trials` or short segments
1414
# of time locked raw data. If you haven't already, you might want to check out
15-
# :ref:`tut_epochs_objects`. In this tutorial we take a deeper look into
15+
# :ref:`sphx_glr_auto_tutorials_plot_object_epochs.py`.
16+
# In this tutorial we take a deeper look into
1617
# construction of epochs and averaging the epoch data to evoked instances.
1718
# First let's read in the raw sample data.
1819
data_path = mne.datasets.sample.data_path()
@@ -139,7 +140,7 @@
139140
# you might ask. They're different because ``picks`` is simply a list of
140141
# channel indices and as the epochs were constructed, also a new info structure
141142
# is created where the channel indices run from 0 to ``epochs.info['nchan']``.
142-
# See :ref:`tut_info_objects` for more information.
143+
# See :ref:`sphx_glr_auto_tutorials_plot_info.py` for more information.
143144
picks = mne.pick_types(epochs.info, meg=True, eog=True)
144145
evoked_left = epochs['Auditory/Left'].average(picks=picks)
145146
evoked_right = epochs['Auditory/Right'].average(picks=picks)

tutorials/plot_info.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
"""
2-
.. _tut_info_objects:
2+
The :class:`~mne.Info` data structure
3+
=====================================
34
4-
The :class:`Info <mne.Info>` data structure
5-
===========================================
6-
7-
The :class:`Info <mne.Info>` data object is typically created
5+
The :class:`~mne.Info` data object is typically created
86
when data is imported into MNE-Python and contains details such as:
97
108
- date, subject information, and other recording details

tutorials/plot_object_raw.py

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
# -*- coding: utf-8 -*-
22
"""
3-
.. _tut_raw_objects:
3+
The :class:`~mne.io.Raw` data structure: continuous data
4+
========================================================
45
5-
The :class:`Raw <mne.io.Raw>` data structure: continuous data
6-
=============================================================
7-
8-
Continuous data is stored in objects of type :class:`Raw <mne.io.Raw>`.
6+
Continuous data is stored in objects of type :class:`~mne.io.Raw`.
97
The core data structure is simply a 2D numpy array (channels × samples)
108
(in memory or loaded on demand) combined with an
11-
:class:`Info <mne.Info>` object (`.info` attribute)
12-
(see :ref:`tut_info_objects`).
9+
:class:`~mne.Info` object (`.info` attribute)
10+
(see :ref:`sphx_glr_auto_tutorials_plot_info.py`).
1311
1412
The most common way to load continuous data is from a .fif file. For more
1513
information on :ref:`loading data from other formats <ch_convert>`, or
@@ -43,20 +41,20 @@
4341
# variable directly but rely on indexing syntax detailed just below.
4442

4543
###############################################################################
46-
# Information about the channels contained in the :class:`Raw <mne.io.Raw>`
47-
# object is contained in the :class:`Info <mne.Info>` attribute.
44+
# Information about the channels contained in the :class:`~mne.io.Raw`
45+
# object is contained in the :class:`~mne.Info` attribute.
4846
# This is essentially a dictionary with a number of relevant fields (see
49-
# :ref:`tut_info_objects`).
47+
# :ref:`sphx_glr_auto_tutorials_plot_info.py`).
5048

5149

5250
###############################################################################
5351
# Indexing data
5452
# -------------
5553
#
56-
# To access the data stored within :class:`Raw <mne.io.Raw>` objects,
57-
# it is possible to index the :class:`Raw <mne.io.Raw>` object.
54+
# To access the data stored within :class:`~mne.io.Raw` objects,
55+
# it is possible to index the :class:`~mne.io.Raw` object.
5856
#
59-
# Indexing a :class:`Raw <mne.io.Raw>` object will return two arrays: an array
57+
# Indexing a :class:`~mne.io.Raw` object will return two arrays: an array
6058
# of times, as well as the data representing those timepoints. This works
6159
# even if the data is not preloaded, in which case the data will be read from
6260
# disk when indexing. The syntax is as follows:
@@ -113,16 +111,16 @@
113111
print('Number of channels reduced from', nchan, 'to', raw.info['nchan'])
114112

115113
###############################################################################
116-
# --------------------------------------------------
117-
# Concatenating :class:`Raw <mne.io.Raw>` objects
118-
# --------------------------------------------------
114+
# ------------------------------------------
115+
# Concatenating :class:`~mne.io.Raw` objects
116+
# ------------------------------------------
119117
#
120-
# :class:`Raw <mne.io.Raw>` objects can be concatenated in time by using the
121-
# :func:`append <mne.io.Raw.append>` function. For this to work, they must
122-
# have the same number of channels and their :class:`Info
123-
# <mne.Info>` structures should be compatible.
118+
# :class:`~mne.io.Raw` objects can be concatenated in time by using the
119+
# :func:`~mne.io.Raw.append` function. For this to work, they must
120+
# have the same number of channels and their :class:`~mne.Info`
121+
# structures should be compatible.
124122

125-
# Create multiple :class:`Raw <mne.io.RawFIF>` objects
123+
# Create multiple :class:`~mne.io.Raw` objects
126124
raw1 = raw.copy().crop(0, 10)
127125
raw2 = raw.copy().crop(10, 20)
128126
raw3 = raw.copy().crop(20, 40)

tutorials/plot_point_spread.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
"""
2-
.. _point_spread:
3-
42
Corrupt known signal with point spread
53
======================================
64
@@ -58,8 +56,9 @@
5856
fwd['info']['bads'] = []
5957
inv_op = read_inverse_operator(fname_inv)
6058

61-
raw = mne.io.RawFIF(op.join(data_path, 'MEG', 'sample',
62-
'sample_audvis_raw.fif'))
59+
raw = mne.io.read_raw_fif(op.join(data_path, 'MEG', 'sample',
60+
'sample_audvis_raw.fif'))
61+
raw.set_eeg_reference(projection=True)
6362
events = mne.find_events(raw)
6463
event_id = {'Auditory/Left': 1, 'Auditory/Right': 2}
6564
epochs = mne.Epochs(raw, events, event_id, baseline=(None, 0), preload=True)

0 commit comments

Comments
 (0)