diff --git a/doc/sphinxext/mne_doc_utils.py b/doc/sphinxext/mne_doc_utils.py index 7df361e4af1..e626838f251 100644 --- a/doc/sphinxext/mne_doc_utils.py +++ b/doc/sphinxext/mne_doc_utils.py @@ -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 diff --git a/doc/sphinxext/related_software.py b/doc/sphinxext/related_software.py index ac1b741b9af..d13625d28b1 100644 --- a/doc/sphinxext/related_software.py +++ b/doc/sphinxext/related_software.py @@ -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: " ): @@ -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: @@ -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 diff --git a/tools/circleci_dependencies.sh b/tools/circleci_dependencies.sh index 2ecc9718ab2..e389f1f53ff 100755 --- a/tools/circleci_dependencies.sh +++ b/tools/circleci_dependencies.sh @@ -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 openneuro-py pactools \ plotly pycrostates pyprep pyriemann python-picard sesameeg \ - sleepecg tensorpac yasa meegkit eeg_positions + sleepecg tensorpac yasa meegkit eeg_positions wfdb diff --git a/tutorials/intro/70_report.py b/tutorials/intro/70_report.py index cc32d02679b..fe87c0f3a44 100644 --- a/tutorials/intro/70_report.py +++ b/tutorials/intro/70_report.py @@ -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. diff --git a/tutorials/inverse/20_dipole_fit.py b/tutorials/inverse/20_dipole_fit.py index 2b640aa8fc2..e72e76dd0fd 100644 --- a/tutorials/inverse/20_dipole_fit.py +++ b/tutorials/inverse/20_dipole_fit.py @@ -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)