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 pymmatgen. |
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() Generator[pathlib.Path, None, None][source]#
Get a temporary folder and delete it after use.
- class aiida_vasp.utils.pmg.PymatgenAdapator(node: aiida.orm.CalcJobNode, store_cache: bool = True)[source]#
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 pymmatgen.
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(file_names: Optional[List[str]] = None) None[source]#
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: str | pathlib.Path) None[source]#
Export the VASP calculation files to a destination folder
- _get_pmg_object(name: str) Any[source]#
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[source]#
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: Any, store_cache: bool = True) pymatgen.io.vasp.Vasprun[source]#
Return the Vasprun object
- aiida_vasp.utils.pmg.get_outcar(node: Any, store_cache: bool = True) pymatgen.io.vasp.Outcar[source]#
Return the OUTCAR object
- aiida_vasp.utils.pmg.get_incar(node: Any, store_cache: bool = True) pymatgen.io.vasp.Incar[source]#
Return the INCAR object
- aiida_vasp.utils.pmg.get_kpoints(node: Any, store_cache: bool = True) pymatgen.io.vasp.Kpoints[source]#
Return the Kpoints object
- aiida_vasp.utils.pmg.get_ibzkpt(node: Any, store_cache: bool = True) pymatgen.io.vasp.Kpoints[source]#
Return the Kpoints object using the IBZKPT file
- aiida_vasp.utils.pmg.convert_pymatgen_potcar_folder(src: pathlib.Path | str, dst: pathlib.Path | str) None[source]#
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