airsspy.restools#
Tools for handling res files
Module Contents#
Classes#
Class representing a RES file. |
Functions#
Extract information from res file. Returns a dictionary. The structure of he res file is not extracted |
|
Save the relaxed structure in res format which is compatible with the
|
|
Parse TITL line and return a TitlInfo object |
|
Read a RES file, return as (TitlInfo, ase.Atoms) |
|
Read a RES file, return as (TitlInfo, rem_lines, pymatgen.Structure, spins) |
|
Get spacegroup of atoms using spglib |
|
Calculate minimum separations given species and distance matrix |
|
Return string representation of the minimum separations |
Data#
API#
- airsspy.restools.extract_res(fname: str) Dict[str, Union[str, float, int, List[str]]][source]#
Extract information from res file. Returns a dictionary. The structure of he res file is not extracted
- airsspy.restools.save_airss_res(atoms: ase.Atoms, info_dict: Dict[str, Any], fname: Optional[str] = None, force_write: bool = False) None[source]#
Save the relaxed structure in res format which is compatible with the
cryanprogram.
- airsspy.restools.TITLE_KEYS#
[‘label’, ‘pressure’, ‘volume’, ‘enthalpy’, ‘spin’, ‘spin_abs’, ‘natoms’, ‘symm’, ‘flag1’, ‘flag2’, …
- airsspy.restools.TitlInfo#
‘namedtuple(…)’
- airsspy.restools.RES_COORD_PATT#
‘compile(…)’
- airsspy.restools.RES_COORD_PATT_WITH_SPIN#
‘compile(…)’
- airsspy.restools.parse_titl(line: str) airsspy.restools.TitlInfo[source]#
Parse TITL line and return a TitlInfo object
- airsspy.restools.read_res_atoms(lines: List[str]) Tuple[airsspy.restools.TitlInfo, ase.Atoms][source]#
Read a RES file, return as (TitlInfo, ase.Atoms)
- airsspy.restools.read_res_pmg(lines: List[str]) Tuple[airsspy.restools.TitlInfo, List[str], Optional[pymatgen.core.Structure], List[float]][source]#
Read a RES file, return as (TitlInfo, rem_lines, pymatgen.Structure, spins)
- airsspy.restools.get_spacegroup_atoms(atoms: ase.Atoms, symprec: float = 1e-05, angle_tolerance: float = -1.0) str[source]#
Get spacegroup of atoms using spglib
- airsspy.restools.get_minsep(species: List[str], distance_matrix: numpy.ndarray) Dict[str, float][source]#
Calculate minimum separations given species and distance matrix
Args: species: A list of species symbols distance_matrix: The distance matrix
Returns: Dictionary of {set(s1, s2): minsep}
- airsspy.restools.format_minsep(minsep: Dict[str, float]) str[source]#
Return string representation of the minimum separations
- class airsspy.restools.RESFile(structure: Union[ase.Atoms, pymatgen.core.Structure, None], data: Dict[str, Any], lines: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None)[source]#
Class representing a RES file.
The SHELX file contains both the structure and computed properties as well as metadata.
Initialization
Initialize a RESFile object.
Args: structure: ASE Atoms or pymatgen Structure instance data: Dictionary containing underlying data lines: Raw lines of the RES file metadata: Additional metadata
- classmethod from_string(string: str) airsspy.restools.RESFile[source]#
Construct from a string
- classmethod from_lines(lines: List[str], include_structure: bool = True, only_titl: bool = False) airsspy.restools.RESFile[source]#
Construct from lines
- classmethod from_file(fname: str, include_structure: bool = True, only_titl: bool = False) airsspy.restools.RESFile[source]#
Construct from a file