-
Notifications
You must be signed in to change notification settings - Fork 17
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
Test a case with plotly renderer #63
Test a case with plotly renderer #63
Conversation
Advanced JSON output data
Thanks for submitting your first pull request! You are awesome! 🤗 |
for more information, see https://pre-commit.ci
I agree that the situation is not ideal, but from the discussion in #55 it seems to be a good compromise. Do you see a better solution?
Outputs can have
Yes and I'm afraid we have no choice anyway, because metadata can be custom, so we don't know its structure in advance. |
I checked that it indeed works since we have #57. Let's address your other comments in another PR. |
FYI the We could add something like a cast_all(cell, float, int, escape_keys={"source", "outputs"})
def cast_all(o, from, to, escape_keys: Optional[Container]=None):
escape_keys = escape_keys or set()
...
if isinstance(o, dict):
for k, v in o.items():
if k not in escape_keys:
... |
Also note that a widget output will look like this: "outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1da8a6e0747b43e78b9e1d9e59e76067",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"IntSlider(value=0)"
]
},
"metadata": {},
"output_type": "display_data"
}
], With a |
I was talking about the |
This adds a test against a notebook that contains a plotly JSON output (from the plotly renderer).
This test works because of #57. But it stands as a proof that we should be really careful with casting.
Moreover, I deeply think that we should skip the code cells outputs cast for performance reason because a plotly plot with millions of points will require looping on the millions of float items for no reasons.
Casting metadata is probably find as the data structure is probably quickly traverse most of the time.