Skip to main content

Automatic generation of crystal structure descriptions

Project description

robocrystallographer logo

PyPI version Codacy Grade Codacy Coverage CircleCI

Robocrystallographer is a tool to generate text descriptions of crystal structures. Similar to how a real-life crystallographer would analyse a structure, robocrystallographer looks at the symmetry, local environment, and extended connectivity when generating a description. The package includes utilities for identifying molecule names, component orientations, heterostructure information, and more...

Usage

Robocrystallographer can be used from the command-line or from a python API. The package integrates with the Materials Project to for allow generation of structure descriptions directly from Materials Project ids. For example, to generate the description of SnO2 (mp-856), one can simply run:

robocrys mp-856

Alternatively, a structure file can be specified in place of a Materials Project id. Robocrystallographer supports the same file formats as pymatgen, including the Crystallographic Information Format (CIF), and common electronic structure package formats such as POSCAR files. More information can be found on the command-line interface page.

Python interface

The two core classes in robocrystallographer are:

  • StructureCondenser: to condense the structure into an descriptive JSON representation.
  • StructureDescriber: to turn the condensed structure into a text description.

A minimal working example for generating text descriptions is simply:

from pymatgen import Structure
from robocrys import StructureCondenser, StructureDescriber

structure = Structure.from_file("my_structure.cif") # other file formats also supported

# alternatively, uncomment the lines below to use the MPRester object
# to fetch structures from the Materials Project database
# from pymatgen import MPRester
# structure = MPRester(API_KEY=None).get_structure_by_material_id("mp-856")

condenser = StructureCondenser()
describer = StructureDescriber()

condensed_structure = condenser.condense_structure(structure)
description = describer.describe(condensed_structure)

Where structure is a pymatgen Structure object. Both classes have many options for customising the output of the structure descriptions. More information is provided in the module documentation.

Intermediate JSON format

The format of the intermediate JSON representation is detailed on the condensed structure format page.

Example output

An example of the output generated by robocrystallographer for SnO2 (mp-856) is given below:

SnO2 crystal structure

SnO2 is Rutile structured and crystallizes in the tetragonal P4_2/mnm space group. The structure is three-dimensional. Sn(1) is bonded to six equivalent O(1) atoms to form a mixture of edge and corner-sharing SnO6 octahedra. The corner-sharing octahedral tilt angles are 51°. All Sn(1)–O(1) bond lengths are 2.09 Å. O(1) is bonded in a trigonal planar geometry to three equivalent Sn(1) atoms.

How to cite robocrystallographer

Please considering citing the following publication if using robocrystallographer in your work:

Ganose, A., & Jain, A. (2019). Robocrystallographer: Automated crystal structure text descriptions and analysis. MRS Communications, 9(3), 874-881. https://doi.org/10.1557/mrc.2019.94

Installation

Robocrystallographer can be installed using pip:

pip install robocrys

Robocrystallographer requires Python 3.6+. The OpenBabel package is required to determine molecule names. This is an optional requirement but its use is recommended for best results. If you are using the Conda package management system, OpenBabel can be installed using:

conda install -c conda-forge openbabel

What’s new?

Track changes to robocrystallographer through the Changelog.

Contributing

Robocrystallographer is in early development but we still welcome your contributions. Please read our contribution guidelines for more information. We maintain a list of all contributors here.

License

Robocrystallographer is released under a modified BSD license; the full text can be found here.

Acknowledgements

Logo by Somewan from the Noun Project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robocrys-0.2.6.tar.gz (3.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

robocrys-0.2.6-py3-none-any.whl (3.8 MB view details)

Uploaded Python 3

File details

Details for the file robocrys-0.2.6.tar.gz.

File metadata

  • Download URL: robocrys-0.2.6.tar.gz
  • Upload date:
  • Size: 3.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for robocrys-0.2.6.tar.gz
Algorithm Hash digest
SHA256 d76315881193abec75e8e73773f88eca29a18f543f441aee28b8f6122bca8ad5
MD5 b3cdb3be32a1f34352d67397586bc02c
BLAKE2b-256 dde790ea9e40b514c283e8c25add99a02e9216778cbd6b54262ecba82a7f6743

See more details on using hashes here.

File details

Details for the file robocrys-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: robocrys-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for robocrys-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6635a36be8c4de346bdca34439fa5d31b9e4418ceadc7b8a609666fa84caf49c
MD5 1aba78c541ad3e7584d0fdd9580199f9
BLAKE2b-256 55a9a32939726de309712ed497c3b31d16ce31f1a2b86c3efc7a99d4bd1d8ec7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page