-
Notifications
You must be signed in to change notification settings - Fork 190
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
JSON serialization of OrbitControls fails with jupyter_client 7.0.3 #366
Comments
Thanks for reporting. I believe this should be fixed in |
Actually I believe this should be fixed here in pythreejs. Python's
|
Awesome! Let me know if I can help and work on a pull request. |
I was wrong. Infinity and NaN are not part of the JSON specification, even though it's valid JavaScript and JavaScript decoders supports it. The issue comes from ipython/ipykernel#708 specifically, as Infinity and NaN are not being "cleaned" anymore. For now I can only suggest either downgrading ipykernel to <6.4 or jupyter_client to <7. I am trying to push a fix to |
Awesome, thanks a lot! |
This will be fixed by jupyter/jupyter_client#708 (at least, we will only see a Warning but the widget will work again) Though we will need to update pythreejs at some point, having a custom serializer to support Infinity/NaN, as it's not valid JSON, similar to what ipydatagrid does: https://github.com/bloomberg/ipydatagrid/blob/main/ipydatagrid/datagrid.py#L172-L178 |
Yeah, we should make some serializers for "extended floats".. |
any update on this? I'm having to downgrade my jupyter_client version in the meantime |
Hello vidartf, Please pardon me for not following proper protocol. I just posted the following message to you at #378 I’m a newbie programmer working with Jupyter Notebook and pythreejs. All 3 of my project files at https://github.com/LtAirman/ChargeFieldTopics stopped working this morning. They no longer display the pythreejs rendered scene. Over the last few months the cell setting up the rendered scene displayed a UserWarning, due to non JSON compliant infinite values. I believe you identified the problem, involving the pythreejs orbital camera, in issues 366 and 378 which I’ve been following. It was my impression this non-finite number problem would be corrected with the upcoming ipywidget 8 release, seeing no rendered output at all is an awful surprise. What do I do now? I’d appreciate any guidance or information you might provide in this matter. |
Update, happy to report my projects' pythreejs rendered outputs are now working properly. Along with the UserWarning that is. I double posted this message at #378. |
I believe a recent change in the json serialization within
jupyter_client
leads to the following error when trying to useOrbitControls
in a jupyter notebook.The issue is caused by default values of
+/- Inf
for some parameters inOrbitControls
This can also be seen in the second cell of the built-in example.
Here is a minimal (non)-working example:
Removing the commented lines will insert finite values for all parameters that would default
to +/- Inf
otherwise, after which the serialization works again.System info:
The text was updated successfully, but these errors were encountered: