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

Reapply warning suppression at the website building level #312

Open
droumis opened this issue Jun 19, 2024 · 3 comments
Open

Reapply warning suppression at the website building level #312

droumis opened this issue Jun 19, 2024 · 3 comments

Comments

@droumis
Copy link
Collaborator

droumis commented Jun 19, 2024

No description provided.

@maximlt
Copy link
Collaborator

maximlt commented Jun 20, 2024

nbsite has a feature that allows to inject some startup code that is executed before running the cells of a notebook evaluated with the NotebookDirective. It even ships with a default startup file that ignores all warnings.

import warnings

warnings.filterwarnings("ignore")

import matplotlib as mpl

mpl.use('agg')

try:
    import holoviews.plotting.bokeh  # noqa
except Exception:
    pass

try:
    import holoviews.plotting.mpl as hmpl
    hmpl.MPLPlot.fig_alpha = 0
except Exception:
    pass

There are now some HoloViz websites (param, hvplot, examples) whose notebook (and MyST Markdown) pages are no longer built with nbsite and its NotebookDirective but directly with sphinx and https://github.com/executablebooks/MyST-NB. As far as I can see, they do not offer this startup configuration feature that nbsite has. We need to find a way to enable that, opening an issue on MyST-NB (or wherever it's relevant) would make sense too.

@hoxbro
Copy link
Collaborator

hoxbro commented Sep 28, 2024

We could, for our CI, maybe set the following environment variable: PYTHONWARNINGS="ignore"

@maximlt
Copy link
Collaborator

maximlt commented Sep 30, 2024

We could, for our CI, maybe set the following environment variable: PYTHONWARNINGS="ignore"

This works but is also a bigger hammer since it not only ignores the warnings emitted when running the code/notebook but also those potentially emitted by the doc build toolchain (sphinx, pydata-sphinx-theme, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants