Skip to content

Commit 6028982

Browse files
authored
MAINT: Fix doc build (#13076)
1 parent 5f2b7f1 commit 6028982

File tree

6 files changed

+25
-15
lines changed

6 files changed

+25
-15
lines changed

doc/sphinxext/mne_doc_utils.py

+2
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ def reset_warnings(gallery_conf, fname):
9797
r"numpy\.core is deprecated and has been renamed to numpy\._core",
9898
# matplotlib
9999
"__array_wrap__ must accept context and return_scalar.*",
100+
# nibabel
101+
"__array__ implementation doesn't accept.*",
100102
):
101103
warnings.filterwarnings( # deal with other modules having bad imports
102104
"ignore", message=f".*{key}.*", category=DeprecationWarning

doc/sphinxext/related_software.py

+16-8
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ def _get_packages() -> dict[str, str]:
173173
packages = sorted(packages, key=lambda x: x.lower())
174174
packages = [RENAMES.get(package, package) for package in packages]
175175
out = dict()
176+
reasons = []
176177
for package in status_iterator(
177178
packages, f"Adding {len(packages)} related software packages: "
178179
):
@@ -183,12 +184,17 @@ def _get_packages() -> dict[str, str]:
183184
else:
184185
md = importlib.metadata.metadata(package)
185186
except importlib.metadata.PackageNotFoundError:
186-
pass # raise a complete error later
187+
reasons.append(f"{package}: not found, needs to be installed")
188+
continue # raise a complete error later
187189
else:
188190
# Every project should really have this
191+
do_continue = False
189192
for key in ("Summary",):
190193
if key not in md:
191-
raise ExtensionError(f"Missing {repr(key)} for {package}")
194+
reasons.extend(f"{package}: missing {repr(key)}")
195+
do_continue = True
196+
if do_continue:
197+
continue
192198
# It is annoying to find the home page
193199
url = None
194200
if "Home-page" in md:
@@ -204,15 +210,17 @@ def _get_packages() -> dict[str, str]:
204210
if url is not None:
205211
break
206212
else:
207-
raise RuntimeError(
208-
f"Could not find Home-page for {package} in:\n"
209-
f"{sorted(set(md))}\nwith Summary:\n{md['Summary']}"
213+
reasons.append(
214+
f"{package}: could not find Home-page in {sorted(md)}"
210215
)
216+
continue
211217
out[package]["url"] = url
212218
out[package]["description"] = md["Summary"].replace("\n", "")
213-
bad = [package for package in packages if not out[package]]
214-
if bad and REQUIRE_METADATA:
215-
raise ExtensionError(f"Could not find metadata for:\n{' '.join(bad)}")
219+
reason_str = "\n".join(reasons)
220+
if reason_str and REQUIRE_METADATA:
221+
raise ExtensionError(
222+
f"Could not find suitable metadata for related software:\n{reason_str}"
223+
)
216224

217225
return out
218226

mne/viz/backends/_pyvista.py

-1
Original file line numberDiff line numberDiff line change
@@ -1331,7 +1331,6 @@ def _is_osmesa(plotter):
13311331
)
13321332
gpu_info = " ".join(gpu_info).lower()
13331333
is_osmesa = "mesa" in gpu_info.split()
1334-
print(is_osmesa)
13351334
if is_osmesa:
13361335
# Try to warn if it's ancient
13371336
version = re.findall("mesa ([0-9.]+)[ -].*", gpu_info) or re.findall(

tools/circleci_dependencies.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ python -m pip install --upgrade --progress-bar off \
1313
mne-icalabel mne-lsl mne-microstates mne-nirs mne-rsa \
1414
neurodsp neurokit2 niseq nitime pactools \
1515
plotly pycrostates pyprep pyriemann python-picard sesameeg \
16-
sleepecg tensorpac yasa meegkit eeg_positions
16+
sleepecg tensorpac yasa meegkit eeg_positions wfdb

tutorials/intro/70_report.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
and after each preprocessing step, epoch rejection statistics, MRI slices with overlaid
1313
BEM shells, all the way up to plots of estimated cortical activity.
1414
15-
Compared to a Jupyter notebook, :class:`mne.Report` is easier to deploy, as the
16-
HTML pages it generates are self-contained and do not require a running Python
17-
environment. However, it is less flexible as you can't change code and re-run
18-
something directly within the browser. This tutorial covers the basics of
19-
building a report. As usual, we will start by importing the modules and data we need:
15+
Compared to a Jupyter notebook, :class:`mne.Report` is easier to deploy, as the HTML
16+
pages it generates are self-contained and do not require a running Python environment.
17+
However, it is less flexible as you can't change code and re-run something directly
18+
within the browser. This tutorial covers the basics of building a report. As usual,
19+
we will start by importing the modules and data we need:
2020
"""
2121

2222
# Authors: The MNE-Python contributors.

tutorials/inverse/20_dipole_fit.py

+1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
# %%
8888
# Calculate and visualise magnetic field predicted by dipole with maximum GOF
8989
# and compare to the measured data, highlighting the ipsilateral (right) source
90+
9091
fwd, stc = make_forward_dipole(dip, fname_bem, evoked.info, fname_trans)
9192
pred_evoked = simulate_evoked(fwd, stc, evoked.info, cov=None, nave=np.inf)
9293

0 commit comments

Comments
 (0)