aiida_vasp.utils.pmg#
Tools for using the Pymatgen library with aiida-vasp.
Module Contents#
Classes#
Adaptor for getting pymatgen objects from a VASP calculation/workflow This work by first exporting the calculation to a temporary folder and then parsing the files using pymatgen. |
Functions#
Get a temporary folder and delete it after use. |
|
Return the Vasprun object |
|
Return the OUTCAR object |
|
Return the INCAR object |
|
Return the Kpoints object |
|
Return the Kpoints object using the IBZKPT file |
|
Convert pymatgen potcar folder to a structure used by aiida-vasp |
API#
- aiida_vasp.utils.pmg.temporary_folder()#
Get a temporary folder and delete it after use.
- class aiida_vasp.utils.pmg.PymatgenAdapator(node, store_cache=True)#
Adaptor for getting pymatgen objects from a VASP calculation/workflow This work by first exporting the calculation to a temporary folder and then parsing the files using pymatgen.
Some of the pymatgen objects does not have the from_dict method implemented as required by MSONable. Hence, they can only be reconstructed as a dictionary.
Initialization
Adaptor for getting pymatgen objects from a VASP calculation/workflow
- FILES = None#
- NO_RECONSTRUCT = ['vasprun', 'outcar', 'chgcar']#
- _parse_full(names: Optional[List[str]] = None)#
Parse all files and save to the pmg_objects attribute The assumption is that exporting the calculation folder is the slowest part of the process.
- export_files(dst: Union[pathlib.Path, str])#
Export the VASP calculation files to a destination folder
- _get_pmg_object(name: str)#
Get a pymatgen object
If we can find the object in parsed object , then just return it.
If it is not already parsed, try to load the cache (stored in the extras)
Otherwise, try to export and parse from the files explicitly. (slow)
- Parameters:
name – Name of the object to get (e.g. ‘vasprun’, ‘outcar’, ‘poscar’, ‘incar’, ‘kpoints’, ‘ibzkpt’)
- __enter__() aiida_vasp.utils.pmg.PymatgenAdapator#
Enter the adaptor
- property vasprun: pymatgen.io.vasp.Vasprun#
Return the Vasprun object
- property vasprun_dict: Dict[str, Any]#
Return the Vasprun object as dictionary (will trigger caching)
- property outcar: pymatgen.io.vasp.Outcar#
Return the Outcar object
- property poscar: pymatgen.io.vasp.Poscar#
Return the Poscar object
- property incar: pymatgen.io.vasp.Incar#
Return the Incar object
- property kpoints: pymatgen.io.vasp.Kpoints#
Return the Kpoints object
- property ibzkpt: pymatgen.io.vasp.Kpoints#
Return the IBZKPT object
- aiida_vasp.utils.pmg.get_vasprun(node, store_cache=True) pymatgen.io.vasp.Vasprun#
Return the Vasprun object
- aiida_vasp.utils.pmg.get_outcar(node, store_cache=True) pymatgen.io.vasp.Outcar#
Return the OUTCAR object
- aiida_vasp.utils.pmg.get_incar(node, store_cache=True) pymatgen.io.vasp.Incar#
Return the INCAR object
- aiida_vasp.utils.pmg.get_kpoints(node, store_cache=True) pymatgen.io.vasp.Kpoints#
Return the Kpoints object
- aiida_vasp.utils.pmg.get_ibzkpt(node, store_cache=True) pymatgen.io.vasp.Kpoints#
Return the Kpoints object using the IBZKPT file
- aiida_vasp.utils.pmg.convert_pymatgen_potcar_folder(src: Union[pathlib.Path, str], dst: Union[pathlib.Path, str])#
Convert pymatgen potcar folder to a structure used by aiida-vasp
- Parameters:
src – Path to the pymatgen potcar folder
dst – Path to the aiida-vasp potcar folder
- Returns:
None