Skip to content

Commit

Permalink
add warnings for kspacing and ismear
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamd committed May 27, 2021
1 parent f929bf9 commit a590c4e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion 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
Expand Down Expand Up @@ -79,6 +79,7 @@ def from_task_doc(

reasons = []
data = {}
warnings = []

if str(calc_type) in input_sets:

Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -172,6 +182,7 @@ def from_task_doc(
valid=len(reasons) == 0,
reasons=reasons,
data=data,
warnings=warnings,
)
return doc

Expand Down

0 comments on commit a590c4e

Please sign in to comment.