From a590c4e8a7dd21f04451d252ddb579d1de390d40 Mon Sep 17 00:00:00 2001 From: Shyam D Date: Thu, 27 May 2021 09:56:47 -0700 Subject: [PATCH] add warnings for kspacing and ismear --- emmet-core/emmet/core/vasp/validation.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/emmet-core/emmet/core/vasp/validation.py b/emmet-core/emmet/core/vasp/validation.py index d019e66a04..ab3d46d795 100644 --- a/emmet-core/emmet/core/vasp/validation.py +++ b/emmet-core/emmet/core/vasp/validation.py @@ -1,5 +1,5 @@ from datetime import datetime -from typing import Dict, List, Optional, Union +from typing import Dict, List, Union import numpy as np from pydantic import BaseModel, Field, PyObject @@ -79,6 +79,7 @@ def from_task_doc( reasons = [] data = {} + warnings = [] if str(calc_type) in input_sets: @@ -110,6 +111,15 @@ def from_task_doc( # larger KSPACING means fewer k-points if data["kspacing_delta"] > kspacing_tolerance: reasons.append(DeprecationMessage.KSPACING) + elif data["kspacing_delta"] < kspacing_tolerance: + warnings.append( + f"KSPACING is lower than input set: {data['kspacing_delta']}" + " lower than {kspacing_tolerance} ", + ) + + # warn, but don't invalidate if wrong ISMEAR + if inputs.get("incar", {}).get("ISMEAR") > 0 and bandgap > 0: + warnings.append("Inappropriate smearing settings") # Checking ENCUT encut = inputs.get("incar", {}).get("ENCUT") @@ -172,6 +182,7 @@ def from_task_doc( valid=len(reasons) == 0, reasons=reasons, data=data, + warnings=warnings, ) return doc