diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 38325007a..98998cd3c 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -52,7 +52,8 @@ jobs: fi test: - needs: check-enums + # to-do: add check-enums req after finding solution for pushing to external forks + #needs: check-enums strategy: matrix: os: ["ubuntu-latest"] # TODO openbabel for windows and mac diff --git a/emmet-core/emmet/core/qchem/calc_types/enums.py b/emmet-core/emmet/core/qchem/calc_types/enums.py index a954c8259..a11ad71a0 100644 --- a/emmet-core/emmet/core/qchem/calc_types/enums.py +++ b/emmet-core/emmet/core/qchem/calc_types/enums.py @@ -7,7 +7,6 @@ and/or emmet/core/qchem/calc_types/calc_types.yaml """ - from emmet.core.utils import ValueEnum diff --git a/emmet-core/emmet/core/vasp/calc_types/calc_types.yaml b/emmet-core/emmet/core/vasp/calc_types/calc_types.yaml index cf5590bd5..6cf82c058 100644 --- a/emmet-core/emmet/core/vasp/calc_types/calc_types.yaml +++ b/emmet-core/emmet/core/vasp/calc_types/calc_types.yaml @@ -127,6 +127,9 @@ RUN_TYPES: LASPH: true LUSE_VDW: true Zab_vdW: -1.8867 + GW: + G0W0: + ALGO: Gw0 TASK_TYPES: - NSCF Line - NSCF Uniform diff --git a/emmet-core/emmet/core/vasp/calc_types/enums.py b/emmet-core/emmet/core/vasp/calc_types/enums.py index d40407560..ff43b294f 100644 --- a/emmet-core/emmet/core/vasp/calc_types/enums.py +++ b/emmet-core/emmet/core/vasp/calc_types/enums.py @@ -7,7 +7,6 @@ and/or emmet/core/vasp/calc_types/calc_types.yaml """ - from emmet.core.utils import ValueEnum, IgnoreCaseEnum @@ -18,6 +17,8 @@ class RunType(IgnoreCaseEnum): AM05_U = "AM05+U" B3LYP = "B3LYP" B3LYP_U = "B3LYP+U" + G0W0 = "G0W0" + G0W0_U = "G0W0+U" GGA = "GGA" GGA_U = "GGA+U" HF = "HF" @@ -155,6 +156,32 @@ class CalcType(IgnoreCaseEnum): B3LYP_U_Structure_Optimization = "B3LYP+U Structure Optimization" B3LYP_U_Unrecognized = "B3LYP+U Unrecognized" B3LYP_Unrecognized = "B3LYP Unrecognized" + G0W0_DFPT = "G0W0 DFPT" + G0W0_DFPT_Dielectric = "G0W0 DFPT Dielectric" + G0W0_Deformation = "G0W0 Deformation" + G0W0_Dielectric = "G0W0 Dielectric" + G0W0_Molecular_Dynamics = "G0W0 Molecular Dynamics" + G0W0_NMR_Electric_Field_Gradient = "G0W0 NMR Electric Field Gradient" + G0W0_NMR_Nuclear_Shielding = "G0W0 NMR Nuclear Shielding" + G0W0_NSCF_Line = "G0W0 NSCF Line" + G0W0_NSCF_Uniform = "G0W0 NSCF Uniform" + G0W0_Optic = "G0W0 Optic" + G0W0_Static = "G0W0 Static" + G0W0_Structure_Optimization = "G0W0 Structure Optimization" + G0W0_U_DFPT = "G0W0+U DFPT" + G0W0_U_DFPT_Dielectric = "G0W0+U DFPT Dielectric" + G0W0_U_Deformation = "G0W0+U Deformation" + G0W0_U_Dielectric = "G0W0+U Dielectric" + G0W0_U_Molecular_Dynamics = "G0W0+U Molecular Dynamics" + G0W0_U_NMR_Electric_Field_Gradient = "G0W0+U NMR Electric Field Gradient" + G0W0_U_NMR_Nuclear_Shielding = "G0W0+U NMR Nuclear Shielding" + G0W0_U_NSCF_Line = "G0W0+U NSCF Line" + G0W0_U_NSCF_Uniform = "G0W0+U NSCF Uniform" + G0W0_U_Optic = "G0W0+U Optic" + G0W0_U_Static = "G0W0+U Static" + G0W0_U_Structure_Optimization = "G0W0+U Structure Optimization" + G0W0_U_Unrecognized = "G0W0+U Unrecognized" + G0W0_Unrecognized = "G0W0 Unrecognized" GGA_DFPT = "GGA DFPT" GGA_DFPT_Dielectric = "GGA DFPT Dielectric" GGA_Deformation = "GGA Deformation" diff --git a/emmet-core/emmet/core/vasp/calc_types/utils.py b/emmet-core/emmet/core/vasp/calc_types/utils.py index e26e67dd9..2134896fc 100644 --- a/emmet-core/emmet/core/vasp/calc_types/utils.py +++ b/emmet-core/emmet/core/vasp/calc_types/utils.py @@ -40,7 +40,7 @@ def _variant_equal(v1, v2) -> bool: return v1 == v2 # This is to force an order of evaluation - for functional_class in ["HF", "VDW", "METAGGA", "GGA"]: + for functional_class in ["GW", "HF", "VDW", "METAGGA", "GGA"]: for special_type, params in _RUN_TYPE_DATA[functional_class].items(): if all( _variant_equal(parameters.get(param, None), value) @@ -122,6 +122,9 @@ def task_type( elif incar.get("IBRION", 1) == 0: calc_type.append("Molecular Dynamics") + elif incar.get("ALGO", "Normal").lower() == "gw0": + calc_type.append("NSCF Uniform") + if len(calc_type) == 0: return TaskType("Unrecognized") diff --git a/emmet-core/emmet/core/vasp/calculation.py b/emmet-core/emmet/core/vasp/calculation.py index e87c771b6..05f78a960 100644 --- a/emmet-core/emmet/core/vasp/calculation.py +++ b/emmet-core/emmet/core/vasp/calculation.py @@ -2,6 +2,7 @@ # mypy: ignore-errors +import os import logging from datetime import datetime from pathlib import Path @@ -754,7 +755,13 @@ def from_vasp_files( volumetric_files = [] if volumetric_files is None else volumetric_files vasprun = Vasprun(vasprun_file, **vasprun_kwargs) outcar = Outcar(outcar_file) - contcar = Poscar.from_file(contcar_file) + if ( + os.path.getsize(contcar_file) == 0 + and vasprun.parameters.get("NELM", 60) == 1 + ): + contcar = Poscar(vasprun.final_structure) + else: + contcar = Poscar.from_file(contcar_file) completed_at = str(datetime.fromtimestamp(vasprun_file.stat().st_mtime)) output_file_paths = _get_output_file_paths(volumetric_files)