Skip to content

Commit 5887c6f

Browse files
committed
BUG: Fix doc building bugs
1 parent 8ee60d0 commit 5887c6f

File tree

8 files changed

+12
-9
lines changed

8 files changed

+12
-9
lines changed

doc/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
os.environ["MNE_BROWSER_OVERVIEW_MODE"] = "hidden"
3838
os.environ["MNE_BROWSER_THEME"] = "light"
3939
os.environ["MNE_3D_OPTION_THEME"] = "light"
40+
# https://numba.readthedocs.io/en/latest/reference/deprecation.html#deprecation-of-old-style-numba-captured-errors # noqa: E501
41+
os.environ["NUMBA_CAPTURED_ERRORS"] = "new_style"
4042
sphinx_logger = sphinx.util.logging.getLogger("mne")
4143

4244
# -- Path setup --------------------------------------------------------------

examples/decoding/receptive_field_mtrf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
data = loadmat(join(path, "speech_data.mat"))
5656
raw = data["EEG"].T
5757
speech = data["envelope"].T
58-
sfreq = float(data["Fs"])
58+
sfreq = float(data["Fs"].item())
5959
sfreq /= decim
6060
speech = mne.filter.resample(speech, down=decim, npad="auto")
6161
raw = mne.filter.resample(raw, down=decim, npad="auto")

examples/inverse/mixed_norm_inverse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
)
8888

8989
t = 0.083
90-
tidx = evoked.time_as_index(t)
90+
tidx = evoked.time_as_index(t).item()
9191
for di, dip in enumerate(dipoles, 1):
9292
print(f"Dipole #{di} GOF at {1000 * t:0.1f} ms: " f"{float(dip.gof[tidx]):0.1f}%")
9393

mne/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ def pytest_configure(config):
104104
if os.getenv("PYTEST_QT_API") is None and os.getenv("QT_API") is not None:
105105
os.environ["PYTEST_QT_API"] = os.environ["QT_API"]
106106

107+
# https://numba.readthedocs.io/en/latest/reference/deprecation.html#deprecation-of-old-style-numba-captured-errors # noqa: E501
108+
if "NUMBA_CAPTURED_ERRORS" not in os.environ:
109+
os.environ["NUMBA_CAPTURED_ERRORS"] = "old_style"
110+
107111
# Warnings
108112
# - Once SciPy updates not to have non-integer and non-tuple errors (1.2.0)
109113
# we should remove them from here.

mne/viz/_3d.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3464,6 +3464,7 @@ def plot_sparse_source_estimates(
34643464
plt_show(show)
34653465

34663466
renderer.show()
3467+
renderer.set_camera(distance="auto", focalpoint="auto")
34673468
return renderer.scene()
34683469

34693470

tutorials/io/60_ctf_bst_auditory.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
`FieldTrip bug tracker
2222
<http://bugzilla.fieldtriptoolbox.org/show_bug.cgi?id=2300>`__.
2323
"""
24-
2524
# Authors: Mainak Jas <mainak.jas@telecom-paristech.fr>
2625
# Eric Larson <larson.eric.d@gmail.com>
2726
# Jaakko Leppakangas <jaeilepp@student.jyu.fi>
@@ -39,8 +38,6 @@
3938
from mne.datasets.brainstorm import bst_auditory
4039
from mne.io import read_raw_ctf
4140

42-
print(__doc__)
43-
4441
# %%
4542
# To reduce memory consumption and running time, some of the steps are
4643
# precomputed. To run everything from scratch change ``use_precomputed`` to

tutorials/machine-learning/30_strf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
plt.autoscale(tight=True)
9494
mne.viz.tight_layout()
9595

96-
9796
# %%
9897
# Simulate a neural response
9998
# --------------------------
@@ -186,7 +185,7 @@
186185
rf.fit(X_train, y_train)
187186

188187
# Now make predictions about the model output, given input stimuli.
189-
scores[ii] = rf.score(X_test, y_test)
188+
scores[ii] = rf.score(X_test, y_test).item()
190189
models.append(rf)
191190

192191
times = rf.delays_ / float(rf.sfreq)

tutorials/stats-sensor-space/10_background_stats.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
Here we will briefly cover multiple concepts of inferential statistics in an
99
introductory manner, and demonstrate how to use some MNE statistical functions.
1010
"""
11-
1211
# Authors: Eric Larson <larson.eric.d@gmail.com>
1312
#
1413
# License: BSD-3-Clause
@@ -250,7 +249,8 @@ def plot_t_p(t, p, title, mcc, axes=None):
250249
ps.append(np.zeros(width * width))
251250
mccs.append(False)
252251
for ii in range(n_src):
253-
ts[-1][ii], ps[-1][ii] = permutation_t_test(X[:, [ii]], verbose=False)[:2]
252+
t, p = permutation_t_test(X[:, [ii]], verbose=False)[:2]
253+
ts[-1][ii], ps[-1][ii] = t[0], p[0]
254254
plot_t_p(ts[-1], ps[-1], titles[-1], mccs[-1])
255255

256256
# %%

0 commit comments

Comments
 (0)