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
Support for _repr_mimebundle_ #660
Comments
This seems like a low-hanging fruits with multiple benefits (including for scikit-learn). @lucyleeow , can you look at this please! Thanks! |
+1 from me as well, I am a big fan of supporting community standards. @SylvainCorlay I assume you mean |
@choldgraf yes. Sorry - this is fixed. I work with too many projects. |
you and me both :-) |
@GaelVaroquaux @SylvainCorlay what's a good example of an object with a |
Or should I create my own dummy class? |
Hey @lucyleeow, pardon my brevity as I am responding from my phone. I included a couple of screenshots of usage in the linked scikit-learn issue! Thanks! |
I guess an important question for us, in sphinx-gallery is: which major object uses repr_mimebundle ? I had a quick look and it seems that my typical goto object, the pandas DataFrame, does not implement it in version 1 of pandas. |
I can make a dummy object and use that in the test if there is no 'major object'. |
@GaelVaroquaux IPython uses it, and also all projects that require custom mime types use it (ipywidgets, altair). |
and we should probably use it for plotly, so I'm also interested :-). Thanks for raising this @SylvainCorlay |
An example with altair would be great!!
I'd be so excited to have an example in sphinx-gallery that uses altair.
|
Then that will be a bit more work to than just supporting the |
@GaelVaroquaux should I open a separate (and more general) issue on using the kernel protocol and Jupyter's display system like in jupyter-sphinx to support bokeh, widgets, altair, etc? |
OK, I thought that Altair was javascript only, like plotly :(.
I don't really see how we could support something that needs a jupyter
kernel. It's too heavy for what we do. Plotly, on the other hand is easy
because it is javascript only.
|
I don't think you understand what I mean. All these examples are javascript only. The kernel is only used at build time of the doc. |
Would you like to discuss this real quick - to be on the same page with respect to understanding each other. |
Having everything depend on the kernel is a problem. For instance, you
want to install a new version of a package, and as a consequence it needs
an update of the kernel, which ends up updating the frontend, then
plotly, then pandas, and you're left with a broken jupyterhub (unlikely
but did happen to me last week) or broken data-analysis scripts because
pandas has details that change from a version to another.
It is crucial to avoid long dependence chains. They entail major
operational risks in projects.
|
@GaelVaroquaux would you like to chat? |
Installing a kernel does not update the front-end. This is a weird statement... |
I think one challenge for this is supporting the many different kind of mimetypes that can exist in a mimebundle. Some of the libraries don't just use regular Could get around this by using the IPython display function to display the mimebundle? e.g., that's what scrapbook does here: https://github.com/nteract/scrapbook/blob/master/scrapbook/api.py#L97 |
The Jupyter Python kernel now supports a new repr function called
_repr_mimebundle_
which can be used to provide several representations of the same object in a dictionary. Unlike_repr_[html|json|svg|png...]_
which are only a limited list of supported mimetypes.As an increasing number of packages use
_repr_mimebundle_
it may be interesting for sphinx-gallery to support it.We could start with checking if the mimebundle includes a
text/html
entry and use that in the same way as_repr_html_
is used...Note: jupyter-sphinx's support of
_repr_mimebundle_
was already mentioned here and here.The text was updated successfully, but these errors were encountered: