pyxtal.io module
This module handles reading and write crystal files.
- pyxtal.io.get_cif_str_for_pyxtal(struc, header: str = '', sym_num=None, style: str = 'mp')[source]
Get the cif string for a given structure. The default setting for _atom_site follows the materials project cif
TODO make this a method of the pyxtal class
- Parameters:
struc – pyxtal structure object
header – additional information
sym_num – the number of symmetry operations, None means writing all symops
style – icsd or mp (used in pymatgen)
- pyxtal.io.read_cif(filename)[source]
read the cif, mainly for pyxtal cif output Be cautious in using it to read other cif files
- Parameters:
filename – path of the structure file
- Returns:
pyxtal structure
- pyxtal.io.search_molecules_in_crystal(struc, tol=0.2, once=False, ignore_HH=True, max_bond_length=None)[source]
Function to perform to find the molecule in a Pymatgen structure
- Parameters:
struc – Pymatgen Structure
tol – tolerance value to check the connectivity
once – search only one molecule or all molecules
ignore_HH – whether or not ignore the short H-H in checking molecule
max_bond_length – sets maximum bond length if bond length is missing in bond length database
- Returns:
list of pymatgen molecules positions: list of center positions
- Return type:
molecules
- class pyxtal.io.structure_from_ext(struc, ref_mols, tol=0.2, ignore_HH=False, add_H=False, hn=None)[source]
Bases:
object
- pyxtal.io.write_cif(struc, filename=None, header='', permission='w', sym_num=None, style='mp')[source]
Export the structure in cif format The default setting for _atom_site follows the materials project cif
- Parameters:
struc – pyxtal structure object
filename – path of the structure file
header – additional information
permission – write(w) or append(a+) to the given file
sym_num – the number of symmetry operations, None means writing all symops
style – icsd or mp (used in pymatgen)