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
I'm having some trouble displaying one particular structure (Fe5GeTe2.zip) in Jupyter Lab using crystal toolkit. Normally I can run a cell with just the pymatgen structure object, and crystal toolkit will automatically render the structure below the cell. However, with this specific structure all I receive is a printout of the structure object and the following error:
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
~/miniconda3/envs/scan/lib/python3.8/site-packages/IPython/core/formatters.py in __call__(self, obj, include, exclude)
968
969 if method is not None:
--> 970 return method(include=include, exclude=exclude)
971 return None
972 else:
~/miniconda3/envs/scan/lib/python3.8/site-packages/crystal_toolkit/__init__.py in _repr_mimebundle_(self, include, exclude)
56 if hasattr(self, "get_scene"):
57 return {
---> 58 "application/vnd.mp.ctk+json": self.get_scene().to_json(),
59 "text/plain": help_text_ct + self.__repr__(),
60 }
~/miniconda3/envs/scan/lib/python3.8/site-packages/crystal_toolkit/renderables/structure.py in get_structure_scene(self, origin, legend, draw_image_atoms)
97 )
98
---> 99 site_scene = site.get_scene(legend=legend,)
100 for scene in site_scene.contents:
101 primitives[scene.name] += scene.contents
~/miniconda3/envs/scan/lib/python3.8/site-packages/crystal_toolkit/renderables/site.py in get_site_scene(self, connected_sites, connected_sites_not_drawn, hide_incomplete_edges, incomplete_edge_length_scale, connected_sites_colors, connected_sites_not_drawn_colors, origin, draw_polyhedra, explicitly_calculate_polyhedra_hull, bond_radius, legend)
105 positions=[position],
106 color="#ffffff",
--> 107 radius=self.properties["display_radius"][0],
108 phiStart=phiEnd,
109 phiEnd=np.pi * 2,
KeyError: 'display_radius'
I've tried to trace back the error through the crystal toolkit source code, but unfortunately it's a bit beyond me. The problem appears to be that a site object in crystal toolkit lacks the "display_radius" property, but I'm not sure how this happens. Does it have to do with certain sites having occupancies of less than 1? I can load a different structure in the same notebook and it renders perfectly fine. I'm working with crystal toolkit version 2021.4.2, and JupyterLab version 3.1.0.
Even though other structures were rendering fine, I decided to update crystal toolkit to see if that solved the problem. I updated to version 2021.4.29 fine, but when I went to run jupyter labextension install crystaltoolkit-extension, I got the following error:
An error occured.
ValueError: The extension "crystaltoolkit-extension" does not yet support the current version of JupyterLab.
Conflicting Dependencies:
JupyterLab Extension Package
>=3.1.0-alpha.4 <3.2.0 >=2.0.0 <3.0.0 @jupyterlab/rendermime-interfaces
See the log file for details: /tmp/jupyterlab-debug-dad5s_b7.log
Any advice would be appreciated!
The text was updated successfully, but these errors were encountered:
The current version of crystal toolkit only explicitly supports JupyterLab 3.x or above -- the extension installation is much simpler now, so you just have to pip install ... and jupyter labextension install ... is not required.
It likely is a bug related to the partial occupancies, I will have to investigate.
I'm having some trouble displaying one particular structure (Fe5GeTe2.zip) in Jupyter Lab using crystal toolkit. Normally I can run a cell with just the pymatgen structure object, and crystal toolkit will automatically render the structure below the cell. However, with this specific structure all I receive is a printout of the structure object and the following error:
I've tried to trace back the error through the crystal toolkit source code, but unfortunately it's a bit beyond me. The problem appears to be that a site object in crystal toolkit lacks the "display_radius" property, but I'm not sure how this happens. Does it have to do with certain sites having occupancies of less than 1? I can load a different structure in the same notebook and it renders perfectly fine. I'm working with crystal toolkit version 2021.4.2, and JupyterLab version 3.1.0.
Even though other structures were rendering fine, I decided to update crystal toolkit to see if that solved the problem. I updated to version 2021.4.29 fine, but when I went to run
jupyter labextension install crystaltoolkit-extension
, I got the following error:Any advice would be appreciated!
The text was updated successfully, but these errors were encountered: