You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The glue-jupyter 3D viewer states (used by the ipyvolume viewers) are not serializable due to limits_cache, which is a dictionary with component IDs as its keys.
Expected behavior
The viewer state should be JSON-serializable
Details:
Operating System: Ubuntu 22.04
Python version (python --version): Python 3.11.10
Additional context
This isn't a problem for the Jupyter VisPy volume viewers because the relevant property there is _limits_cache (note the underscore). "Private" properties are not serialized.
Thus, I think we could either:
Prefix limits_cache with an underscore as the VisPy viewer does
I should've mentioned this originally, but one use case where this becomes a problem is if you want to use the viewer state as a traitlet in a Vuetify template, e.g.:
import ipyvuetify as v
import traitlets
classTestTemplate(v.VuetifyTemplate):
@traitlets.default('template')def_template(self):
return"""<div> <!-- Use the state somewhere here, like e.g. --> <p> {{ state }}</p> </div> """state=GlueState().tag(sync=True)
then the following will throw a TypeError: keys must be str, int, float, bool or None, not ComponentID
Describe the bug
The glue-jupyter 3D viewer states (used by the ipyvolume viewers) are not serializable due to
limits_cache
, which is a dictionary with component IDs as its keys.To Reproduce
Expected behavior
The viewer state should be JSON-serializable
Details:
python --version
): Python 3.11.10Additional context
This isn't a problem for the Jupyter VisPy volume viewers because the relevant property there is
_limits_cache
(note the underscore). "Private" properties are not serialized.Thus, I think we could either:
limits_cache
with an underscore as the VisPy viewer doesThe text was updated successfully, but these errors were encountered: