Long CIF edge case
Just mentioning this here in case you were looking for an edge case to include in your testing or something like that.
The website doesn't parse this very long CIF file of this C110 H106 Ge2 Li2 N8 O2 organic molecular crystal (or whatever this is) correctly.
Thanks for the report!
The performance is actually pretty bad for any large crystal right now, it may be an underlying pymatgen issue too, I'll look into it.
Update on this issue. The problem here is two-fold:
(1) the current Materials Project cloud deployment is a little under-resourced, which limits what we can do, and
(2) the visualizer will not perform well for large crystals anyway because the pymatgen bonding algorithms are pretty slow, and because no level-of-detail support has been added to the Three.js-based scene visualizer in mp-react-components meaning that spheres etc. are rendered at too high a fidelity in very large scene where hundreds of objects are present
Suggested resolution is to implement a max_sites attribute on StructureMoleculeComponent and respond with an appropriate error message when this is exceeded.
@mkhorton Hi, Is there any example to show How to parse the CIF file into the the JSON format data which can be displayed in the mp-react-components scene visulizer?
I can’t test this right now, but it would be something like:
import crystal_toolkit # side-effect import to get structure.get_scene()
from pymatgen.core.structure import Structure
structure = Structure.from_file("your_cif.cif")
scene = structure.get_scene()
scene.to_json()
Apologies if I’ve mis-remembered a method name here. Hope this helps!
@mkhorton I
I can’t test this right now, but it would be something like:
import crystal_toolkit # side-effect import to get structure.get_scene() from pymatgen.core.structure import Structure structure = Structure.from_file("your_cif.cif") scene = structure.get_scene() scene.to_json()Apologies if I’ve mis-remembered a method name here. Hope this helps!
@mkhorton I use this way to implement the Visualization of the test.cif. However it lost the lines between the atoms.
test.cif.zip
But it shows well at https://next-gen.materialsproject.org/toolkit after uploading the cif file.
Could you help to tell me the difference? If I missed something?