-
Notifications
You must be signed in to change notification settings - Fork 66
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
Silencing "a jupyter kernel connection is required..." message #776
Comments
Hi @agahkarakuzu, one way to suppress the output is to add a placeholder to the figure, that should/would remove that message. And it will look nicer/cleaner in the process - https://mystmd.org/guide/reuse-jupyter-outputs#placeholder-content - does that fit your use case? |
Hi @stevejpurves, thanks for responding! I already have an interactive figure (widgets are modifying traces on it when connected to a kernel) rendered from the labeled cell output at the initial values of the sliders, and the warning appears right below it. So I assume using a placeholder would remove the content of interest? |
@agahkarakuzu it would replace the entire contents of the figure (all cell outputs) only on initial render, as soon as you connected to a kernel and ran the figure (cell/notebook) it would be replaced with your widgets. It sounds like your cell might be producing 2 outputs though? the first an interactive graph that does not require a kernel and the second containing widgets? [in which case the placeholder is not going to cut it, it would if your passive render was a static image] |
The widget callback is creating/updating the interactive figure. This is how it looks on the page: and on the notebook: with the following input: #| label: interactCylinder
@interact(Ncyl=widgets.IntSlider(min=1, max=100, step=1, value=30,description="# cylinders"), R=widgets.FloatSlider(min=0.5, max=5, step=0.5, value=1.5, description="R cylinder"))
def update(Ncyl, R):
"""Update the visualization based on widget values."""
visualize_random_cylinders(Ncyl=Ncyl, R=R, L=100) |
yes I thought so. I take it you would also want to remove the so it looks like this line in the https://github.com/jupyter-book/myst-theme/blob/50c625864f091f52dc563cd3bd486e68de3625d1/packages/jupyter/src/jupyter.tsx#L90-L91 @myst-theme/jupyter package is the culprit but there's no configuration available for that right now, seems like it could be a "theme option" which would then need to be propagated through, to the PassiveOutputRenderer. it might be better to wait on jupyter-book/myst-theme#429 though.!? |
Thank you so much for the clarification! I'll keep an eye on this PR as it is not really urgent and pretty glad to learn about rehydration through a PR :) |
great, closing this for now then |
Hi!
I was wondering if there is an option to suppress this message in an output rendered through MyST:
thebe/packages/core/src/utils.ts
Line 29 in 2f69ba2
For a cleaner look, I want to add this information in the figure caption and suppress from the output (if possible).
Thank you!
The text was updated successfully, but these errors were encountered: