pychemia.io package¶
Routines to import and export atomic structures. Currently supported are ASCII, CIF and XYZ
Submodules¶
pychemia.io.ascii module¶
Module for support V_sim ascii fileformat Contains routines to load .ascii files and create pychemia Structure objects and to save back to .ascii files
This code was originally created for ASE
-
pychemia.io.ascii.
cell_to_reduced
(full)[source]¶ Transforms the given matrix full into a reduced array used by V_Sim to store box definition.
translated from src/coreTools/toolMatrix.c subroutine tool_matrix_reducePrimitiveVectors
-
pychemia.io.ascii.
load
(filep)[source]¶ Read an V_sim .ascii file and returns a pychemia Structure object
- Args:
- filep: (string) Path to a .ascii file or an
- actual file-like object
- Returns:
- struct: (object) A pychemia Structure object
-
pychemia.io.ascii.
save
(struct, filep, cartesian=True, long_format=True, angdeg=False)[source]¶ Saves a pychemia Structure object in V_sim .ascii fileformat in the simplest way, i.e. using all defaults with no optional keywords. In the first line we add the number of atoms, as this is used by certain code
pychemia.io.cif module¶
Several routines to read and write CIF files
-
class
pychemia.io.cif.
CIFStructure
(cif_blocks, title=None)[source]¶ Bases:
object
-
pychemia.io.cif.
cif_expand
(path, dirname=None, verbose=False)[source]¶ Split a multi-structure CIF file and return a directory with all the CIFs in separated files
Parameters: - path – Path to the file that contain multi-structure
- dirname – Path to the directory where the extracted CIFs will be located, by default it will be the same location of the original file and the name of the directory will be the name of the ‘filename’ without extension
- verbose – Print some extra info
:rtype : str
-
pychemia.io.cif.
get_singlecifs
(dirname, verbose=False)[source]¶ Recursively explores a directory searching for .cif files, determines if they are single or multi-structure, expand those multi and return a list of single-strcuture cif files
Parameters: - dirname – (str) Directory to read CIFS
- verbose – (bool) Verbosity of routine
Returns: