{"id":8599,"library":"robocrys","title":"RoboCryS","description":"RoboCryS (robocrys) is a Python library for the automatic generation of human-readable descriptions of crystal structures. It is currently at version 0.2.13 and sees active development with minor releases every few months, often including dependency updates and compatibility fixes.","status":"active","version":"0.2.13","language":"en","source_language":"en","source_url":"https://github.com/hackingmaterials/robocrystallographer","tags":["materials science","crystallography","data analysis","chemistry","pymatgen","structure description"],"install":[{"cmd":"pip install robocrys","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core functionality for crystal structure representation and analysis.","package":"pymatgen","optional":false},{"reason":"Required for space group and symmetry analysis, often a dependency of pymatgen.","package":"spglib","optional":false},{"reason":"Fundamental package for numerical computing.","package":"numpy","optional":false},{"reason":"Scientific computing library, often used with numpy.","package":"scipy","optional":false}],"imports":[{"symbol":"CrystalDescriptor","correct":"from robocrys.descriptor import CrystalDescriptor"},{"symbol":"Structure","correct":"from pymatgen.core import Structure"}],"quickstart":{"code":"from pymatgen.core import Structure\nfrom robocrys.descriptor import CrystalDescriptor\n\n# Example structure (SrTiO3 perovskite, from space group and lattice parameters)\nstructure = Structure.from_spacegroup(221, 5.5, ['Sr', 'Ti', 'O'], [[0,0,0], [0.5,0.5,0.5], [0.5,0,0]])\n\ndescriptor = CrystalDescriptor()\ndescription = descriptor.describe(structure)\nprint(description)","lang":"python","description":"This example demonstrates how to create a `pymatgen.core.Structure` object and use `robocrys.descriptor.CrystalDescriptor` to generate a textual description of the crystal structure."},"warnings":[{"fix":"Always check the `install_requires` in `robocrys`'s `pyproject.toml` or `setup.py` for compatible `pymatgen` version ranges. Upgrade both `robocrys` and `pymatgen` together (`pip install --upgrade robocrys pymatgen`) to ensure compatibility.","message":"RoboCryS is highly dependent on `pymatgen`, and breaking changes in `pymatgen` can cause compatibility issues. Older `robocrys` versions may fail with newer `pymatgen` versions, and vice-versa.","severity":"breaking","affected_versions":"<0.2.13"},{"fix":"Provide explicit oxidation states to the `CrystalDescriptor` constructor or the `describe` method. For example: `descriptor = CrystalDescriptor(oxidation_states={'Fe': 2, 'O': -2})`.","message":"For complex compounds, especially those with transition metals or mixed valences, RoboCryS may struggle to infer accurate oxidation states automatically. This can lead to less precise or incorrect descriptions.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade `robocrys` to version 0.2.10 or newer (`pip install --upgrade robocrys`) to ensure compatibility with recent `pymatgen` versions that use `n_elems`.","message":"Older versions of `robocrys` (prior to 0.2.10) used the `ntypesp` attribute from `pymatgen.Structure`, which has since been deprecated and replaced with `n_elems` in `pymatgen`.","severity":"deprecated","affected_versions":"robocrys < 0.2.10"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Verify your `spglib` installation by running `python -c \"import spglib\"`. If the structure is highly distorted or chemically non-stoichiometric, `robocrys` might not be suitable; try cleaning or relaxing the structure first.","cause":"Issues with `spglib` installation (a core dependency via `pymatgen`) or a highly distorted, amorphous, or chemically ambiguous structure that `spglib` cannot process.","error":"robocrys.descriptor.CrystalDescriptorError: Could not convert structure to primitive cell with spglib. This often indicates an issue with spglib installation or a highly distorted structure."},{"fix":"Upgrade `robocrys` to version 0.2.10 or newer: `pip install --upgrade robocrys`.","cause":"You are likely using an older version of `robocrys` (before 0.2.10) with a newer `pymatgen` version. `pymatgen` deprecated `ntypesp` in favor of `n_elems`.","error":"AttributeError: 'Structure' object has no attribute 'ntypesp'"},{"fix":"Provide explicit oxidation states to the `CrystalDescriptor` constructor or the `describe` method. For example: `descriptor = CrystalDescriptor(oxidation_states={'ElementA': X, 'ElementB': Y})`.","cause":"RoboCryS attempted to infer oxidation states but failed due to insufficient information, complex chemistry, or the presence of species for which default oxidation states are ambiguous.","error":"ValueError: Could not determine oxidation states for all species."}]}