Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Fix doc build #13076

Merged
merged 3 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/sphinxext/mne_doc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ def reset_warnings(gallery_conf, fname):
r"numpy\.core is deprecated and has been renamed to numpy\._core",
# matplotlib
"__array_wrap__ must accept context and return_scalar.*",
# nibabel
"__array__ implementation doesn't accept.*",
):
warnings.filterwarnings( # deal with other modules having bad imports
"ignore", message=f".*{key}.*", category=DeprecationWarning
Expand Down
24 changes: 16 additions & 8 deletions doc/sphinxext/related_software.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ def _get_packages() -> dict[str, str]:
packages = sorted(packages, key=lambda x: x.lower())
packages = [RENAMES.get(package, package) for package in packages]
out = dict()
reasons = []
for package in status_iterator(
packages, f"Adding {len(packages)} related software packages: "
):
Expand All @@ -183,12 +184,17 @@ def _get_packages() -> dict[str, str]:
else:
md = importlib.metadata.metadata(package)
except importlib.metadata.PackageNotFoundError:
pass # raise a complete error later
reasons.append(f"{package}: not found, needs to be installed")
continue # raise a complete error later
else:
# Every project should really have this
do_continue = False
for key in ("Summary",):
if key not in md:
raise ExtensionError(f"Missing {repr(key)} for {package}")
reasons.extend(f"{package}: missing {repr(key)}")
do_continue = True
if do_continue:
continue
# It is annoying to find the home page
url = None
if "Home-page" in md:
Expand All @@ -204,15 +210,17 @@ def _get_packages() -> dict[str, str]:
if url is not None:
break
else:
raise RuntimeError(
f"Could not find Home-page for {package} in:\n"
f"{sorted(set(md))}\nwith Summary:\n{md['Summary']}"
reasons.append(
f"{package}: could not find Home-page in {sorted(md)}"
)
continue
out[package]["url"] = url
out[package]["description"] = md["Summary"].replace("\n", "")
bad = [package for package in packages if not out[package]]
if bad and REQUIRE_METADATA:
raise ExtensionError(f"Could not find metadata for:\n{' '.join(bad)}")
reason_str = "\n".join(reasons)
if reason_str and REQUIRE_METADATA:
raise ExtensionError(
f"Could not find suitable metadata for related software:\n{reason_str}"
)

return out

Expand Down
1 change: 0 additions & 1 deletion mne/viz/backends/_pyvista.py
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,6 @@ def _is_osmesa(plotter):
)
gpu_info = " ".join(gpu_info).lower()
is_osmesa = "mesa" in gpu_info.split()
print(is_osmesa)
if is_osmesa:
# Try to warn if it's ancient
version = re.findall("mesa ([0-9.]+)[ -].*", gpu_info) or re.findall(
Expand Down
2 changes: 1 addition & 1 deletion tools/circleci_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ python -m pip install --upgrade --progress-bar off \
mne-icalabel mne-lsl mne-microstates mne-nirs mne-rsa \
neurodsp neurokit2 niseq nitime pactools \
plotly pycrostates pyprep pyriemann python-picard sesameeg \
sleepecg tensorpac yasa meegkit eeg_positions
sleepecg tensorpac yasa meegkit eeg_positions wfdb
10 changes: 5 additions & 5 deletions tutorials/intro/70_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
and after each preprocessing step, epoch rejection statistics, MRI slices with overlaid
BEM shells, all the way up to plots of estimated cortical activity.

Compared to a Jupyter notebook, :class:`mne.Report` is easier to deploy, as the
HTML pages it generates are self-contained and do not require a running Python
environment. However, it is less flexible as you can't change code and re-run
something directly within the browser. This tutorial covers the basics of
building a report. As usual, we will start by importing the modules and data we need:
Compared to a Jupyter notebook, :class:`mne.Report` is easier to deploy, as the HTML
pages it generates are self-contained and do not require a running Python environment.
However, it is less flexible as you can't change code and re-run something directly
within the browser. This tutorial covers the basics of building a report. As usual,
we will start by importing the modules and data we need:
"""

# Authors: The MNE-Python contributors.
Expand Down
1 change: 1 addition & 0 deletions tutorials/inverse/20_dipole_fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
# %%
# Calculate and visualise magnetic field predicted by dipole with maximum GOF
# and compare to the measured data, highlighting the ipsilateral (right) source

fwd, stc = make_forward_dipole(dip, fname_bem, evoked.info, fname_trans)
pred_evoked = simulate_evoked(fwd, stc, evoked.info, cov=None, nave=np.inf)

Expand Down
Loading