executablebooks / MyST-NB

Parse and execute ipynb files in Sphinx

Home Page:https://myst-nb.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

holoviews plots lead to warnings at build

fmaussion opened this issue · comments

Describe the bug

context

I am using jupyter-book to build tutorials such as this one:

https://oggm.org/training-lahore/day_4/04_glacier_water_resources.html#interactive-glacier-map

Recently (after updating jupter-book, sphinx-book theme, etc, the builds new raise this warning:

/home/mowglie/disk/Dropbox/HomeDocs/git/oggm-edu-notebooks/oggm-edu/glacier_water_resources_projections_pre16.ipynb:200002: WARNING: skipping unknown output mime type: application/vnd.holoviews_load.v0+json [mystnb.unknown_mime_type]
/home/mowglie/disk/Dropbox/HomeDocs/git/oggm-edu-notebooks/oggm-edu/glacier_water_resources_projections_pre16.ipynb:200002: WARNING: skipping unknown output mime type: application/vnd.holoviews_load.v0+json [mystnb.unknown_mime_type]
/home/mowglie/disk/Dropbox/HomeDocs/git/oggm-edu-notebooks/oggm-edu/glacier_water_resources_projections_pre16.ipynb:200002: WARNING: skipping unknown output mime type: application/vnd.holoviews_exec.v0+json [mystnb.unknown_mime_type]
/home/mowglie/disk/Dropbox/HomeDocs/git/oggm-edu-notebooks/oggm-edu/glacier_water_resources_projections_pre16.ipynb:580002: WARNING: skipping unknown output mime type: application/vnd.holoviews_exec.v0+json [mystnb.unknown_mime_type]

The page however displays correctly

expectation
This did not happen in earlier versions.

problem
This is a problem because the warnings are verbose and do not seem to indicate a real issue in web rendering

Reproduce the bug

Create a book with an interactive plot from bokeh, for example:

# hvplot is a plotting library relying on bokeh
# you'll need to install it alongside with pandas for this cell to work
import hvplot.pandas

# pandas is a very useful data analysis library
import pandas as pd

# This makes the plot
ts = pd.Series(index=x, data=y)
ts.hvplot().opts(title='An interactive plot', width=500)

Then build the book

List your environment

Jupyter Book      : 0.15.1
External ToC      : 0.3.1
MyST-Parser       : 0.18.1
MyST-NB           : 0.17.1
Sphinx Book Theme : 1.0.0
Jupyter-Cache     : 0.5.0
NbClient          : 0.5.13

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

You can hide these warnings if you need to, using this Sphinx configuration option: suppress_warnings = ["mystnb.unknown_mime_type"]. That can be set in _config.yml:

sphinx:
  recursive_update: true
  config:
    suppress_warnings = ["mystnb.unknown_mime_type"]

I'm taking your 👍 as an indication that this solves your problem! Closing the issue :)